Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.0
Description
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
Attachments
Issue Links
- duplicates
-
PDFBOX-2514 partialy loaded PDF file by pdfbox
- Closed
- is related to
-
PDFBOX-1992 text in pdf with convertToImage not rendered
- Closed
- relates to
-
PDFBOX-1019 PDF conversion to image crashes the JVM
- Closed
-
PDFBOX-1742 type1CFont font with null encoding
- Closed
- supercedes
-
PDFBOX-1019 PDF conversion to image crashes the JVM
- Closed
-
PDFBOX-1849 Isartor test 6-3-5-t01-fail-a does not return the expected error code
- Closed