Fop
  1. Fop
  2. FOP-1405

[PATCH] ExpertEncoding and ExpertSubsetEncoding not detected for Type 1 fonts

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: fonts
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other
    • External issue ID:
      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.

      1. expertencoding.diff
        7 kB
        Adrian Cumiskey

        Activity

        Hide
        Adrian Cumiskey added a comment -

        Attachment expertencoding.diff has been added with description: patch file

        Show
        Adrian Cumiskey added a comment - Attachment expertencoding.diff has been added with description: patch file
        Hide
        Adrian Cumiskey added a comment -

        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.

        Show
        Adrian Cumiskey added a comment - 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.
        Hide
        Jeremias Maerki added a comment -

        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

        Show
        Jeremias Maerki added a comment - 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
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          People

          • Assignee:
            fop-dev
            Reporter:
            Adrian Cumiskey
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development