pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilman Hausherr (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4469) Exception in thread "main" java.io.EOFException when load a TTF file
Date Thu, 21 Feb 2019 17:48:00 GMT

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

Tilman Hausherr commented on PDFBOX-4469:

PDFBox needs the GSUB segment for vertical usage (PDFBOX-4106). I don't want to change PDFBox
for a broken font. If bold simsun is used frequently in China, then you should be able to
find it (I couldn't, but I searched only in english), or better: buy it.

What you could do is to disable the broken segment:
 - open your font in a hex editor
 - go to offset 13918067
 - change 01 into 00
 - save

Alternatively (if you want to create PDFs), use the normal SimSun font, and simulate bold
by using {{contentStream.setRenderingMode(RenderingMode.FILL_STROKE)}}.

It might also be possible to fix the problem with FontForge, but I didn't try it, their UI
is terrible. DTL OTMaster 3.7 light can open the font, and the GSUB script list part is a
complete mess (which confirmed to me that it isn't a PDFBox bug), but that version can't save.
(but it is a very nice tool)

> 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: PDFPBoxTest.zip, 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

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

View raw message