Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3757

TTFSubsetter scrambles PostScript names and unicode codepoints when subset contains diaeresis

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.5
    • 2.0.6, 3.0.0 PDFBox
    • FontBox
    • 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.

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            tofi86 Tobias Fischer
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: