Class PDFFontSetImpl

  • All Implemented Interfaces:
    PDFFontSet, java.io.Serializable

    public class PDFFontSetImpl
    extends java.lang.Object
    implements PDFFontSet
    Provides access to an aggregated font set, including CSS20FontSet, PSFontSet, and FallbackFontSet.
    See Also:
    Serialized Form
    • Method Detail

      • addFont

        public void addFont​(Font font,
                            Platform platForm,
                            ULocale locale)
                     throws PDFFontException
        Description copied from interface: PDFFontSet
        Add a given Font to the PDFFontSet for use in font lookup. There is an inherent priority ordering based on the order that Font objects are added with earlier added fonts having higher priority. The font shall be added for locale and platform specified by clients. If either of the platform and locale are passed as null then defaults shall be used.
        Specified by:
        addFont in interface PDFFontSet
        Parameters:
        font - a non-null valid Font object
        Throws:
        PDFFontException
      • addFont

        public void addFont​(Font font,
                            PostscriptFontDescription[] psDescriptions,
                            CSS20FontDescription[] cssDescriptions)
                     throws PDFFontException
        Description copied from interface: PDFFontSet
        Add a given Font to the PDFFontSet. The provided PostScript and CSS font descriptions will be used during font lookup. Either array of descriptions can be null. If the Font's native font descriptions are also desired, both this API and other addFont variants can be called with the same Font instance. There is an inherent priority ordering based on the order that Font objects are added with earlier added fonts having higher priority.
        Specified by:
        addFont in interface PDFFontSet
        Throws:
        PDFFontException
      • addFont

        public void addFont​(Font[] fonts,
                            Platform platForm,
                            ULocale locale)
                     throws PDFFontException
        Description copied from interface: PDFFontSet
        Add an array of Font objects to the PDFFontSet for use in font lookup. There is an inherent priority ordering based on the order that Font objects are added with earlier added fonts having higher priority. The font shall be added for locale and platform specified by clients. If either of the platform and locale are passed as null then defaults shall be used.
        Specified by:
        addFont in interface PDFFontSet
        Parameters:
        fonts - a non-null array of non-null valid Font objects
        Throws:
        PDFFontException
      • addFallbackFont

        public void addFallbackFont​(java.util.Locale locale,
                                    Font font)
                             throws PDFFontException
        Description copied from interface: PDFFontSet
        Add a given Font to the PDFFontSet for use as a fallback font for the given locale. There is an inherent priority ordering based on the order that Font objects are added with earlier added fonts having higher priority.
        Specified by:
        addFallbackFont in interface PDFFontSet
        Parameters:
        locale - the locale for which this fallback font should be used
        font - a non-null valid Font object
        Throws:
        PDFFontException
      • addFallbackFont

        public void addFallbackFont​(java.util.Locale locale,
                                    Font[] fonts)
                             throws PDFFontException
        Description copied from interface: PDFFontSet
        Add an array of Font objects to the PDFFontSet for use as a fallback font for the given locale. There is an inherent priority ordering based on the order that Font objects are added with earlier added fonts having higher priority.
        Specified by:
        addFallbackFont in interface PDFFontSet
        Parameters:
        locale - the locale for which this fallback font should be used
        fonts - a non-null array of non-null valid Font objects
        Throws:
        PDFFontException
      • getPSFont

        public Font getPSFont​(PostscriptFontDescription fontDescription,
                              java.util.Locale locale,
                              boolean substitute)
                       throws PDFFontException
        Get the PS fonts.
        Parameters:
        substitute - If true and the exact fontDescription is not found, a fallback font can be returned.
        Returns:
        a font matching the description provided or a fallback appropriate for the locale.
        Throws:
        PDFFontException
      • getFallbackFont

        public Font getFallbackFont​(java.util.Locale locale)
        Gets the preferred fallback font for locale supplied
        Parameters:
        locale - locale
        Returns:
        fallback font
      • toString

        public java.lang.String toString()
        A debugging string containing information about the contents of the PDFFontSetImpl instance.
        Overrides:
        toString in class java.lang.Object
      • addFont

        public void addFont​(Font font)
                     throws PDFFontException
        Description copied from interface: PDFFontSet
        Add a given Font to the PDFFontSet for use in font lookup. There is an inherent priority ordering based on the order that Font objects are added with earlier added fonts having higher priority. The font shall be added for default locale available and windows platform. If clients want to specify locale and platform then they should call PDFFontSet.addFont(Font, Platform, ULocale).
        Specified by:
        addFont in interface PDFFontSet
        Parameters:
        font - a non-null valid Font object
        Throws:
        PDFFontException
      • addFont

        public void addFont​(Font[] fonts)
                     throws PDFFontException
        Description copied from interface: PDFFontSet
        Add an array of Font objects to the PDFFontSet for use in font lookup. There is an inherent priority ordering based on the order that Font objects are added with earlier added fonts having higher priority. These fonts shall be added for default locale available and windows platform. If clients want to specify locale and platform then they should call PDFFontSet.addFont(Font[], Platform, ULocale).
        Specified by:
        addFont in interface PDFFontSet
        Parameters:
        fonts - a non-null array of non-null valid Font objects
        Throws:
        PDFFontException
      • setIgnoreFontLoadingErrors

        public void setIgnoreFontLoadingErrors​(boolean ignoreFontLoadingErrors)
        Description copied from interface: PDFFontSet
        Sets if any error while adding font to fontset should be ignored
        Specified by:
        setIgnoreFontLoadingErrors in interface PDFFontSet