Why Font Source And TrueType Binaries Are Never The Same
George Williams explains why a TrueType font cannot have a 1-1 relation to a SFD file:
FontForge is a font editor, it is designed to change things, not leave them the same. If you wish exact copying I suggest you use “cp” it will do the job nicely. Differences in the sfd files are caused by:
- FontForge has given you a GDEF table with glyph class info. It does this because these fonts contain different classes of glyphs, and in an opentype font that should be noted.
- One difference which is not visible in the sfd file is that FontForge has generated a ‘GPOS’ table rather than a ‘kern’ table in the ttf. If you don’t like that behavior you can have it generate a ‘kern’ table by turning off the OpenType Option when you generate the font.
- FontForge has reordered the glyphs. It does this because it always outputs glyphs in encoding order. If you wish glyphs to retain the original ordering simply change the encoding to “Glyph Order” (or “Original”) before generating the ttf.
- Each time it loads a new truetype font it generates a random PostScript XUID. This will be different because it must be different. XUIDs are completely irrelevant for truetype but are stored in the sfd file in case the user chooses to generate a PostScript font from this source at some time in the future. None of these changes has any effect on the semantics of the generated ttf. The same information is present in both fonts.
- The UnderlinePosition is different. This is indeed a bug in FontForge, which is now fixed. (It’s also well nigh irrelevant. Nobody cares about this field. It is stored differently in the ttf ‘post’ table than it is in a PostScript FontInfo dict (which is why ff gets it wrong)) The attached patch fixes this — it is also in the cvs tree.
- The “Instruction size” field of the ‘maxp’ table is different. I believe that the entry in the LiberationSans font as released on the RedHat site is incorrect — I believe the value FontForge has placed in its stead is correct. I believe this because the length of the ‘fpgm’ table of that font is 1797 and this is greater than the 1111 value stored in the ‘maxp’ table.

The Why Font Source And TrueType Binaries Are Never The Same by David Crossland, except the quotations and unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
May 25, 2008 |
Comments
Leave a Reply
