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

Unexpected end of TTF stream reached

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.0.8
    • None
    • None
    • None

    Description

      I get the following error

      java.io.IOException: Unexpected end of TTF stream reached
      at org.apache.fontbox.ttf.TTFDataStream.read(TTFDataStream.java:274) ~[fontbox-2.0.8.jar:2.0.8]
      at org.apache.fontbox.ttf.TTFDataStream.readString(TTFDataStream.java:91) ~[fontbox-2.0.8.jar:2.0.8]
      at org.apache.fontbox.ttf.TTFDataStream.readString(TTFDataStream.java:64) ~[fontbox-2.0.8.jar:2.0.8]
      at org.apache.fontbox.ttf.PostScriptTable.read(PostScriptTable.java:104) ~[fontbox-2.0.8.jar:2.0.8]
      at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:335) ~[fontbox-2.0.8.jar:2.0.8]
      at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:173) ~[fontbox-2.0.8.jar:2.0.8]
      at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:150) ~[fontbox-2.0.8.jar:2.0.8]
      at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:106) ~[fontbox-2.0.8.jar:2.0.8]
      at org.apache.pdfbox.pdmodel.font.PDType0Font.load(PDType0Font.java:79) ~[pdfbox-2.0.8.jar:2.0.8]
      }}

      when I try to load the attached TTF file. This is original Lobster-regular font but it was converted from WOFF to TTF format by the FontVerter library. The TTF itself correctly displays in Windows, so I could expect it should be correctly loaded by PDType0Font.load() method

      Attachments

        1. Lobster-Regular-bad.otf
          418 kB
          Dmitri Blinov
        2. Lobster-Regular.woff
          153 kB
          Dmitri Blinov
        3. Lobster-Regular.ttf
          397 kB
          Dmitri Blinov
        4. image-2018-02-12-15-49-56-197.png
          127 kB
          Dmitri Blinov
        5. image-2018-02-12-15-50-25-544.png
          38 kB
          Dmitri Blinov

        Activity

          People

            Unassigned Unassigned
            dmitri_blinov Dmitri Blinov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: