Dmitri Blinov commented on PDFBOX-4104:

I'm a little bit confused with the font terminology unfortunately, so I cannot 
tell OTF from TTF, sorry. From the FontVerter examples and source code I have 
learned that they are about the same, at least they put FontFormat.TTF as 
synonym for FontFormat.OTF in code. But, I've got your hint, I have checked 
that Windows reports both original and bad fonts are (OpenType) formats, so 
this means OTF. Nevertheless I have checked that the original font file loads 
without any exceptions.

> Unexpected end of TTF stream reached
> ------------------------------------
>                 Key: PDFBOX-4104
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4104
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.8
>            Reporter: Dmitri Blinov
>            Priority: Minor
>         Attachments: Lobster-Regular-bad.otf, Lobster-Regular.ttf, 
> Lobster-Regular.woff
> I get the following error 
> {quote}
> 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]
> }}
> {quote} 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

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to