edwardtufte / et-book

A webfont of the typeface used in Edward Tufte’s books.
https://edwardtufte.github.io/et-book
MIT License
1.17k stars 100 forks source link

Real sources #1

Closed davelab6 closed 8 years ago

davelab6 commented 8 years ago

The source files in the repo today are apparently PFB files, old PostScript Type1 binary fonts.

Is a .fog or .vfb file available (the native source file for Fontographer and Fontlab)

godbyk commented 8 years ago

In addition, the purported source files in the source/1-suit/ directory are empty files (0 bytes).

adamschwartz commented 8 years ago

Thanks for letting me know. I’m not sure what’s going on here. There appears to be some issue with GitHub when committing these. I absolutely have the original files and will figure out a better way to post them. More to come.

adamschwartz commented 8 years ago

Try downloading and unzipping https://github.com/edwardtufte/et-bembo/blob/gh-pages/source/1-suit/originals.zip. Then see if you can make a PR back to https://github.com/edwardtufte/et-bembo with those files and we’ll see if they’re 0 bytes in the PR.

godbyk commented 8 years ago

@adamschwartz The zip file contains 0-byte files except for the resource forks located in the __MACOSX directory. The actual font source files in the zip file are still 0 bytes, however.

adamschwartz commented 8 years ago

That’s odd because the zip file is 539 KB according to GitHub (https://github.com/edwardtufte/et-bembo/blob/gh-pages/source/1-suit/originals.zip) and when I unzip that on my machine I see this:

screen shot 2015-09-20 at 3 40 27 pm screen shot 2015-09-20 at 3 40 29 pm screen shot 2015-09-20 at 3 40 31 pm screen shot 2015-09-20 at 3 40 33 pm

etc...

godbyk commented 8 years ago

When I download the zip file, it's the same size for me. But all that space is consumed by the __MACOSX files and none of it by the original files.

Could you try zipping them up from the terminal?

$ cd /path/to/originals
$ tar -czvf originals.tgz *

Then upload the originals.tgz file.

davelab6 commented 8 years ago

Zipping that way will not help; you need to convert them from resource-fork using 'mac style' fonts to 'dos style' fonts.

godbyk commented 8 years ago

@davelab6 Ah, thanks for the input. I have no idea how fonts are managed on a Mac. I didn't realize that there were two different styles like that!

adamschwartz commented 8 years ago

Sounds like we’re all good. I’ll keep looking into how to get these in there such that the zip isn’t necessary, but for the time being I’ll close this ticket. Thanks @davelab6 and @godbyk.

davelab6 commented 8 years ago

https://fontforge.github.io/macformats.html

adamschwartz commented 8 years ago

Thanks @davelab6

ljrk0 commented 3 years ago

There are multiple hurdles here,

  1. The files not being stored "as-is" but as Resource Forks
  2. The Resource Forks are Apple Double encoded
  3. The files are still Apple-specific Suitcase bitmap files or Postscript files in a slightly different, Apple-specific, format.

To access the original sources on a non macOS system, this is what I did:

  1. Install the Perl module Mac::AppleSingleDouble
  2. Install fondu

After unzipping, I use the first tool to convert all the Apple Double files like ._ETBook-BoldLF.suit (Suitcase font for bitmap) or ._ETBookBolLF (Postscript Outline) to Resource Fork files which have the same name but with.rsrc attached. Script from this SuperUser answer:

$ unzip originals.zip
$ cd originals
$ rm -f *
$ find ../__MACOSX/originals -type f -not -name '*.rsrc' -exec perl -MMac::AppleSingleDouble -e 'for(@ARGV) {
    $a = new Mac::AppleSingleDouble($_);
    if(open $f, ">", $_.".rsrc") {
        binmode $f;
        print $f $a->get_entry(2);
        close $f;
    }
}' {} \;

The Suitcase Resource Forks (*.suit.rsrc) contain FOND (fond family information) as well as NFNT (bitmap font) resources which will be extracted and converted into .bdf and .afm files.

The Postscript Resource Forks (no .suit) contain POST (Postscript font) information which is simply dumped into a .pfb outline font.

$ find ../__MACOSX/originals -type f -name '*.rsrc' -exec fondu -afm {} \;     

Now, the originals directory contains both, the Bitmap and font metrics, as well as the PostScript Type 1 fonts. We can actually even compare the checksum of the .pfbs extracted this way and the ones uploaded on GitHub, and we will find that they are the same to the last bit (given we don't have any hash collisions :D)

These are the "new" files: originals2.zip