ICEpdf
  1. ICEpdf
  2. PDF-53

Creation of font using AWT font style and size hinting.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.1
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      ICEpdf OS

      Description

      This improvement/fix came in via the forms and once again many thanks to Pedro Rivera for his work.

      When the OS version of ICEpdf does font substitution a lot of work is done to derive the font family from the font name. The Font class in Java has a constructor that takes style information which it can used to find a matching system font when available. The fix proposed by Pedro helps with this process and especially with the application of the correct font styles; italic and bold.
      1. Font.java
        37 kB
        Patrick Corless

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19369 Thu Oct 08 07:16:29 MDT 2009 patrick.corless PDF-53 - applied font style hinting for the awt font creation during font substitution in the OS version.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/ofont/OFont.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/ofont/Font.java
        Commit graph ADD /icepdf/trunk/icepdf/core/src/org/icepdf/core/util/FontUtil.java
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/FontManager.java
        Patrick Corless created issue -
        Hide
        Patrick Corless added a comment -

        Code contribution from Pedro Rivera

        Show
        Patrick Corless added a comment - Code contribution from Pedro Rivera
        Patrick Corless made changes -
        Field Original Value New Value
        Attachment Font.java [ 12024 ]
        Patrick Corless made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Patrick Corless added a comment -

        Applied the patch more or less as suggested. I did however move some font name utility calls out to a new FontUtil class and updated the FontManager and ofont.Font class appropriately.

        There is still some code duplication around FontManager.guessFontSytle() and FontUtil.guestAWTFontStyle. The font manager version is uses a different constant value which has a dependency on how we cache system fonts in the ViewerRI. It would be nice to have only one call here but it would mean introducing a mechanism to invalidate previously created font cache files.

        Show
        Patrick Corless added a comment - Applied the patch more or less as suggested. I did however move some font name utility calls out to a new FontUtil class and updated the FontManager and ofont.Font class appropriately. There is still some code duplication around FontManager.guessFontSytle() and FontUtil.guestAWTFontStyle. The font manager version is uses a different constant value which has a dependency on how we cache system fonts in the ViewerRI. It would be nice to have only one call here but it would mean introducing a mechanism to invalidate previously created font cache files.
        Patrick Corless made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 3.1 [ 10181 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19383 Fri Oct 09 05:49:15 MDT 2009 patrick.corless PDF-53 - update font substitution logic with a seperate substitution test for font family names.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/ofont/Font.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19385 Fri Oct 09 05:59:34 MDT 2009 patrick.corless PDF-53 - update font substitution logic with a separate substitution test for font family names.
        Files Changed
        Commit graph MODIFY /icepdf/tags/icepdf-3.1.0/icepdf/core/src/org/icepdf/core/pobjects/fonts/ofont/Font.java
        Hide
        Patrick Corless added a comment -

        Found several regressions related to this approach. We need to keep the basefont name more or less as is for the java.awt.Font.decode method to work correctly. I've changed the logic font substitution logic slightly so that it will do a round of font searches based on the family names of the fonts with out any style information. Just have to run it though qa to see what the consequences are.

        Show
        Patrick Corless added a comment - Found several regressions related to this approach. We need to keep the basefont name more or less as is for the java.awt.Font.decode method to work correctly. I've changed the logic font substitution logic slightly so that it will do a round of font searches based on the family names of the fonts with out any style information. Just have to run it though qa to see what the consequences are.
        Patrick Corless made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Patrick Corless added a comment -

        Changes passed QA. marking as resolved.

        Show
        Patrick Corless added a comment - Changes passed QA. marking as resolved.
        Patrick Corless made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Patrick Corless added a comment -

        ICEpdf 3.1.0 has been released, closing issues.

        Show
        Patrick Corless added a comment - ICEpdf 3.1.0 has been released, closing issues.
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24037 Mon Feb 28 11:30:57 MST 2011 patrick.corless PDF-216 added font style hinting to rest of font class, similar to PDF-53, improves font substitution accuracy.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/fonts/ofont/Font.java

          People

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

            Dates

            • Created:
              Updated:
              Resolved: