You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2019/02/20 20:10:00 UTC

[jira] [Commented] (PDFBOX-4469) Exception in thread "main" java.io.EOFException when load a TTF file

    [ https://issues.apache.org/jira/browse/PDFBOX-4469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16773359#comment-16773359 ] 

Tilman Hausherr commented on PDFBOX-4469:
-----------------------------------------

The length of the file is 15MB on my W7 system and 17MB on my W10 system. Your upload here is 13.33 MB. Could it be you downloaded the font from some "free font site"? It could be cut off when downloading, or their own file could be cut off.
 
I did some debugging and it got weird when reading langSysCount in the GSUB table. This should be 1 but was 40. And the first few items had an offset of 40 too.

> Exception in thread "main" java.io.EOFException when load a TTF file
> --------------------------------------------------------------------
>
>                 Key: PDFBOX-4469
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4469
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.13
>            Reporter: berylbai
>            Priority: Critical
>         Attachments: simsumb.ttf
>
>
> Exception in thread "main" java.io.EOFException
>  at java.io.RandomAccessFile.readUnsignedShort(RandomAccessFile.java:745)
>  at org.apache.fontbox.ttf.RAFDataStream.readUnsignedShort(RAFDataStream.java:128)
>  at org.apache.fontbox.ttf.GlyphSubstitutionTable.readLangSysTable(GlyphSubstitutionTable.java:150)
>  at org.apache.fontbox.ttf.GlyphSubstitutionTable.readScriptTable(GlyphSubstitutionTable.java:129)
>  at org.apache.fontbox.ttf.GlyphSubstitutionTable.readScriptList(GlyphSubstitutionTable.java:98)
>  at org.apache.fontbox.ttf.GlyphSubstitutionTable.read(GlyphSubstitutionTable.java:78)
>  at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:353)
>  at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:173)
>  at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:150)
>  at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:87)
>  at org.apache.pdfbox.pdmodel.font.PDType0Font.load(PDType0Font.java:66)
>  at pdfboxTest.Test.main(Test.java:69)
>  
> PDFont font = PDType0Font.load(doc, new File("simsumb.ttf"));



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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