ICEpdf
  1. ICEpdf
  2. PDF-256

Fonts not rendered correctly when JLP Diaper Pin used

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.2
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      -
    • Workaround Exists:
      Yes
    • Workaround Description:
      Remove icepdf-viewer.jar but most are using the viewer.

      Description

      ALFor.pdf does not render correctly when the JLP Diaper Pin font library is installed. This issue only occurs when the icepdf-viewer.jar is on the classpath. With the JLR Diaper Fonts present the font substitution logging is as follows:

      Font Substitution: Found system font: TimesNewRomanPS-BoldMT for named font Times New Roman,Bold
      Font Substitution: Found system font: New for named font Times New Roman

      Full stack trace attached along with screen shots, PDF, and JLP Diaper Pin fonts which can be found here: http://www.fontspace.com/gorillablu/jlr-diaper-pin.


        Activity

        Tyler Johnson created issue -
        Hide
        Tyler Johnson added a comment -

        The necessary conditions to reproduce the problem on the customer´s Windows XP SP3 and Windows 7 are:

        1) Install the JLR Diaper Pin font in the Windows fonts directory.

        2) Run the attached sample code including icepdf-core.jar, icepdf-pro.jar, icepdf-pro-intl.jar, and icepdf-viewer.jar in the classpath.

        As you stated, removing the icepdf-viewer.jar from the classpath fixes the problem, but this is not an option for us.

        Show
        Tyler Johnson added a comment - The necessary conditions to reproduce the problem on the customer´s Windows XP SP3 and Windows 7 are: 1) Install the JLR Diaper Pin font in the Windows fonts directory. 2) Run the attached sample code including icepdf-core.jar, icepdf-pro.jar, icepdf-pro-intl.jar, and icepdf-viewer.jar in the classpath. As you stated, removing the icepdf-viewer.jar from the classpath fixes the problem, but this is not an option for us.
        Tyler Johnson made changes -
        Field Original Value New Value
        Attachment Incorrect.jpg [ 12852 ]
        Tyler Johnson made changes -
        Attachment Correct.jpg [ 12853 ]
        Tyler Johnson made changes -
        Attachment logging_output_20110207T15_45.txt [ 12854 ]
        Tyler Johnson made changes -
        Attachment 9774_testcase.zip [ 12866 ]
        Hide
        Tyler Johnson added a comment -

        The example in the test case folder does not have any references to icepdf-viewer.jar and helped narrow down the cause of the problem. The test case zip also has the PDF.

        Show
        Tyler Johnson added a comment - The example in the test case folder does not have any references to icepdf-viewer.jar and helped narrow down the cause of the problem. The test case zip also has the PDF.
        Patrick Corless made changes -
        Salesforce Case []
        Fix Version/s 4.2 [ 10243 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24110 Wed Mar 09 13:51:27 MST 2011 patrick.corless PDF-256 update fontManager to sort the font list to avoid a nasty corner case where a system font "new" is getting substituted for "timesnewroman".
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/FontManager.java
        Hide
        Patrick Corless added a comment -

        I thought it looked pretty good with the new family font, oh well.

        The font in question gets stored as "new" as it's name and family which when compared to the lookup name "timesnewroman" produces a hit as the search is indexof based. I think a quick work around to the problem is to insure the fontList is always ordered. The reason the app work OK without the viewer jar is that there is no saving of system font data to map and to disk. The saving randomizes the list which produces mixed results.

        When the viewer jar is missing the fonts are always in order and the search work more reliably in for this strange test case. I don't see any major concerns with sorting the fontList values by font name. The side effect is that this corner case is resolved.

        Show
        Patrick Corless added a comment - I thought it looked pretty good with the new family font, oh well. The font in question gets stored as "new" as it's name and family which when compared to the lookup name "timesnewroman" produces a hit as the search is indexof based. I think a quick work around to the problem is to insure the fontList is always ordered. The reason the app work OK without the viewer jar is that there is no saving of system font data to map and to disk. The saving randomizes the list which produces mixed results. When the viewer jar is missing the fonts are always in order and the search work more reliably in for this strange test case. I don't see any major concerns with sorting the fontList values by font name. The side effect is that this corner case is resolved.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24122 Thu Mar 10 13:48:51 MST 2011 patrick.corless PDF-256 - added "new" to the list of excluded fonts, found a couple other case were the font came into play.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/FontManager.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24143 Tue Mar 15 08:23:33 MDT 2011 patrick.corless PDF-256 adjusted font substitution algorithm to take font style into account when doing last ditch match attempt before blindly selecting the first font in the list of possible fonts
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/FontManager.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24144 Tue Mar 15 09:17:47 MDT 2011 patrick.corless PDF-256 changed sort order of font list to be sorted a-z.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/FontManager.java
        Tyler Johnson made changes -
        Salesforce Case [5007000000Fd9XJ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: