Class FontPropertiesManager


  • public class FontPropertiesManager
    extends Object

    This class provides a basic Font Properties Management system. In order for font substitution to work more reliable it is beneficial that it has read and cached all system fonts. The scanning of system fonts can be time consuming and negatively effect the startup time of the library. To speed up subsequent launches of the PDF library the fonts are stored using the Preferences API using a backing store determined by the JVM.

    // read/store the font cache. FontPropertiesManager.getInstance().loadOrReadSystemFonts();

    NOTE: This class was significantly simplified in version 6.3 of ICEpdf and the release notes should be consulted if any custom font loading was implemented by the end user.

    Since:
    6.3
    • Method Detail

      • getInstance

        public static FontPropertiesManager getInstance()
        Gets the singleton instance of the FontPropertiesManager.
        Returns:
        instance of FontPropertiesManager.
      • loadOrReadSystemFonts

        public void loadOrReadSystemFonts()
        Checks to see if there is currently any cached properties in the the backing store; if so they are returned, otherwise a full read of the system fonts takes place and the results are stored in the backing store.
      • readDefaultFontProperties

        public void readDefaultFontProperties​(String... paths)
        Reads the default font paths as defined by the FontManager class. This method does not save any fonts to the backing store.
        Parameters:
        paths - any extra paths that should be read as defined by the end user.
      • readFontProperties

        public void readFontProperties​(String... paths)
        Reads the only font paths defined by the param paths. This method does not save any fonts to the backing store or read system fonts as defined by FontManager.readSystemFonts(String[]).
        Parameters:
        paths - paths that should be read for system fonts.
      • loadProperties

        public void loadProperties()
        Loads any font properties stored in the backing store and are passed to the FontManager class. No changes are made to the backing store.
      • clearProperties

        public void clearProperties()
        Clears the backing store of all font properties.
      • saveProperties

        public void saveProperties()
        Saves all fonts properties defined in the FontManager to the backing store.
      • isFontPropertiesEmpty

        public boolean isFontPropertiesEmpty()
        Check to see if any font properties are stored in the backing store.
        Returns:
        true if font properties backing store is empty, otherwise false.
      • getFontManager

        public static FontManager getFontManager()
        Gets the underlying fontManger instance which is also a singleton.
        Returns:
        current font manager