[ https://issues.apache.org/jira/browse/PDFBOX-1844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Hewson updated PDFBOX-1844: -------------------------------- Attachment: Type1Parser.java Type1Lexer.java type1-v3.patch I've fixed the issues with the PDFBOX-1298 file. There was a bug in the lexer as well as two malformed Type 1 fonts in the PDF file. I've updated the patch to v3, and modified the Type1Parser and Type1Lexer files. > [PATCH] Parser for Type 1 Fonts > ------------------------------- > > Key: PDFBOX-1844 > URL: https://issues.apache.org/jira/browse/PDFBOX-1844 > Project: PDFBox > Issue Type: Improvement > Components: FontBox > Affects Versions: 2.0.0 > Reporter: John Hewson > Assignee: Andreas Lehmkühler > Labels: patch, rendering > Attachments: CustomEncoding.java, Token.java, > Type1CharStringReader.java, Type1Font.java, Type1Glyph2D.java, > Type1Lexer.java, Type1Mapping.java, Type1Parser.java, latexdemo.pdf, > redp4581.pdf, test.pdf, type1-v3.patch > > > This patch adds a parser for Type 1 fonts to FontBox and makes use of it in > PDFBox for rendering Type 1 glyphs. This should fix various issues with the > JVM crashing and rendering fonts incorrectly. > It was necessary to modify Type1CharStringParser to handle the > `callothersubr` command and correctly handle subroutines. Likewise, > Type1CharString was modified to support "flex". > This patch does not remove the AWT fallback for non-embedded and standard 14 > fonts because an entirely new fallback system is needed and suitable fonts > will need to be shipped as part of PDFBox. This needs to be discussed on the > mailing list and/or in follow-on issue. > Note: To keep this patch small I have not replaced any of the existing ad-hoc > Type 1 parsing code in PDType1Font and preflight. Those classes retain their > original code which can be replaced in subsequent patches/refactoring. I can > open follow-on issues for these. > ~~~ > As well as the patch, the these files were added: > + /pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/Type1Glyph2D.java > + /fontbox/src/main/java/org/apache/fontbox/encoding/CustomEncoding.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Token.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1CharStringReader.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1Font.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1Lexer.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1Mapping.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java > And this file was removed: > - /pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/CFFGlyph2D.java -- This message was sent by Atlassian JIRA (v6.1.5#6160)