Bug 43143 - [PATCH] ExpertEncoding and ExpertSubsetEncoding not detected for Type 1 fonts
Summary: [PATCH] ExpertEncoding and ExpertSubsetEncoding not detected for Type 1 fonts
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fonts (show other bugs)
Version: trunk
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-16 07:27 UTC by Adrian Cumiskey
Modified: 2012-04-01 06:40 UTC (History)
0 users



Attachments
patch file (7.27 KB, patch)
2007-08-16 07:28 UTC, Adrian Cumiskey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Cumiskey 2007-08-16 07:27:38 UTC
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.
Comment 1 Adrian Cumiskey 2007-08-16 07:28:25 UTC
Created attachment 20669 [details]
patch file
Comment 2 Adrian Cumiskey 2007-10-26 12:22:56 UTC
This patch has now been applied in trunk, so Expert encoded fonts can now be
detected, but more work needs be done to provide support within FOP for them.

Adrian.
Comment 3 Jeremias Maerki 2007-11-15 05:32:17 UTC
I had to revert part of the patch since it produced problems with fonts that
worked before. Hopefully, this fixes it. More info in the commit message:
http://svn.apache.org/viewvc?rev=595297&view=rev
Comment 4 Glenn Adams 2012-04-01 06:40:19 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed