Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.5
-
None
Description
I tried to build a standalone FontSubsetter with the great fontbox tools. It works so far for OpenType/TrueType fonts, but when the glyph subset contains characters with diaeresis (like german umlauts äöü), the TTFSubsetter class scrambles PostScript names and unicode codepoints.
When creating a subset from DejaVuSans.ttf for example, with only those two characters "Ö " (O umlaut and a hair space \u200A), the resulting font subset is recognized as a valid font, but the unicode codepoint 200A in the resulting font file has the postscript name "Dieresis" and the single dieresis are named "uni200A". See screenshot "fontbox-2.0.5-ttfsubsetter_dieresis-scrambled-names.png" and the subsetted Font "Subset-DejaVuSans__dieresis-scrambled-names.ttf".
When there are more glyphs in the subset, more whitespace, special chars and umlauts, the scrambling goes even further and also scrambles unicode codepoints and not only postscript names:
glyphs in subset: "RabenköigKrmloEyGfthsTjHdAu cvFüD. w,äUp:IzWVZSN-ßLC PB5M«»O2013Q©/;x978-()64XJ'!Ä?‹› ...ÜqY &Öé|_•{}[]>#*$^
+"
Resulting font: "Subset-DejaVuSans__scrambled-codepoints.ttf"
Screenshot: "fontbox-2.0.5-ttfsubsetter_scrambled-codepoints.png"
I considder this a bug, as it does not appear when there are no umlauts or diaeresis in the subset.