Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
2.5
-
None
-
None
-
Operating System: other
Platform: Other
-
43143
Description
William (wliem@allette.com.au) came across a problem with FOP when trying to use
his Bundesbahn font.
He reported the following exception :-
Error message generated by FOP:
10/08/2007 06:16:13 org.apache.fop.cli.Main startFOP
SEVERE: Exception
java.lang.NullPointerException
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:191)
---------
java.lang.NullPointerException
at org.apache.fop.fonts.SingleByteFont.hasChar(SingleByteFont.java:103)
at org.apache.fop.fonts.LazyFont.hasChar(LazyFont.java:166)
at org.apache.fop.fonts.Font.hasChar(Font.java:189)
at org.apache.fop.fonts.Font.getCharWidth(Font.java:231)
at
org.apache.fop.layoutmgr.inline.TextLayoutManager.initialize(TextLayoutManager.java:188)
The font he was trying to use had an 'ExpertSubset' encoding which the FOP
PFMFile wasn't able to recognise. Unfortunately I do not have time to implement
Expert and ExpertSubset encoding at the moment, maybe someone could find the
time to do this. You can get the charset mapping in Appendix C of
http://www.adobe.com/devnet/font/pdfs/5176.CFF.pdf.
This patch provides the detection part of the solution and correctly identify
Expert and ExpertSubset encoding and will provide a suitable error in the log if
a type 1 font is used with such an encoding type.
This patch also contains :-
- Checkstyle fixes to the generated CodePointMapping.java
- A fix to the FontLoader loadFont() method. The fontFileURI was being
converted to lowercase (which should work fine on Windows but not on Linux).
Many thanks to William for reporting the problem.
Adrian.