Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.31, 3.0.2 PDFBox
-
None
-
None
Description
As reported to me by T.G.
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.codePointAt(int)" because "uni" is null at org.apache.pdfbox.pdmodel.font.PDTrueTypeFontEmbedder.setWidths(PDTrueTypeFontEmbedder.java:102)
This happens when an existing encoding is passed to PDTrueTypeFont.load() with the 3rd parameter being an existing encoding "with differences" from another font and this encoding has a ".notdef", because this isn't in the Adobe glyph list. The whole thing is done to replace a simple not embedded font with a hopefully equivalent embedded font.
Solution: assume GID 0 for such cases.