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

CFFParser parser treats CIDFont's charset data as SID

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.10
    • 1.8.11
    • FontBox
    • None

    Description

      As stated in Compact Font File specification:

      The charset data, although in the same format as non-CIDFonts, will represent CIDs rather than SIDs, i.e. charstrings are “named” by CIDs in a CIDFont.

      Unfortunately, CFFParser does not consider this specific and always treat charset data as SID: is looking for SID referenced text in String INDEX structure. Since such SID-indexed string does not exist there, it sets the name of the glyph to ".ndef".

      Consequently, CFFParser fails to register correct charstrings, as it associates glyph names to them using a map. As there can be several charstrings, only the last charstring entry is retained.

      Then also CFFFont.getWidth() method fails to return correct width of the given CID as correct link between CID and charstring is lost.

      Attachments

        1. MyriadPro-Regular.cff
          0.7 kB
          Petras
        2. Patch_to_fix_PDFBOX-2923.patch
          4 kB
          Petras
        3. sample-a2b-acrosigned_B.pdf
          153 kB
          Petras

        Activity

          People

            Unassigned Unassigned
            abyss Petras
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: