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

PfbParser fails to parse PFB font with multiple binary records.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0 PDFBox
    • 2.0.31, 3.0.1 PDFBox, 4.0.0
    • FontBox
    • None
    • Patch

    Description

      • The attached PFB font can be opened in FontForge but PfbParser in fontbox fails to read it.
      • The problem is that fontbox assumes there are three records (ascii, binary, ascii) in the PFB file but the binary part is split into multiple shorter chunks (i.e. ascii, binary, ..., binary, ascii).
      • I didn't find that this is forbidden and according to FontForge behavior it seems to be valid.
      • The fix seems to be easy, it is probably sufficient to concatenate the binary records together in PfbParser and the result will work correctly.

      Attachments

        1. 5040.Download_Fonts.pdf
          88 kB
          Andreas Lehmkühler
        2. DejaVuSerifCondensed.pfb
          1.01 MB
          Jaromír Dobrý
        3. PDFBOX-5713_minimal.diff
          2 kB
          Jaromír Dobrý
        4. PDFBOX-5713.diff
          3 kB
          Jaromír Dobrý
        5. pfa_wrapped.pfb
          2.00 MB
          Jaromír Dobrý
        6. type1_embedded.pdf
          1.02 MB
          Jaromír Dobrý

        Activity

          People

            tilman Tilman Hausherr
            jaromirdobry@kadel.cz Jaromír Dobrý
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: