Class PDFFontSetImpl
- java.lang.Object
-
- com.adobe.internal.pdftoolkit.core.fontset.impl.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
-
-
Field Summary
-
Fields inherited from interface com.adobe.internal.pdftoolkit.core.fontset.PDFFontSet
ARABIC, HEBREW, THAI
-
-
Constructor Summary
Constructors Constructor Description PDFFontSetImpl()PDFFontSetImpl(FontResolutionPriority priority)Default constructor that provides no fonts.PDFFontSetImpl(PDFFontSetImpl original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFallbackFont(java.util.Locale locale, Font font)Add a givenFontto thePDFFontSetfor use as a fallback font for the given locale.voidaddFallbackFont(java.util.Locale locale, Font[] fonts)Add an array ofFontobjects to thePDFFontSetfor use as a fallback font for the given locale.voidaddFont(Font font)Add a givenFontto thePDFFontSetfor use in font lookup.voidaddFont(Font[] fonts)Add an array ofFontobjects to thePDFFontSetfor use in font lookup.voidaddFont(Font[] fonts, Platform platForm, ULocale locale)Add an array ofFontobjects to thePDFFontSetfor use in font lookup.voidaddFont(Font font, Platform platForm, ULocale locale)Add a givenFontto thePDFFontSetfor use in font lookup.voidaddFont(Font font, PostscriptFontDescription[] psDescriptions, CSS20FontDescription[] cssDescriptions)Add a givenFontto thePDFFontSet.CSS20FontSetgetCSS20FontSet()Get the CSS20 fonts.FontgetFallbackFont(java.util.Locale locale)Gets the preferred fallback font for locale suppliedFallbackFontSetgetFallbackFontSet()Get the fallback fonts.FontgetPSFont(PostscriptFontDescription fontDescription, java.util.Locale locale, boolean substitute)Get the PS fonts.FontgetPSFont(java.lang.String fontName, java.util.Locale locale, boolean substitute)PSNameResolvergetPSFontSet()Get the PS fonts.booleanhasRootFallback()Returns true if there is a "final fallback" font installed in ULocale.ROOT.voidsetGenericFontFamilyName(CSS20GenericFontFamily family, java.lang.String[] replacements)An array of font family names to use as replacements for the generic CSS font family names.voidsetIgnoreFontLoadingErrors(boolean ignoreFontLoadingErrors)Sets if any error while adding font to fontset should be ignoredvoidsetResolutionPriority(FontResolutionPriority priority)java.lang.StringtoString()A debugging string containing information about the contents of thePDFFontSetImplinstance.
-
-
-
Constructor Detail
-
PDFFontSetImpl
public PDFFontSetImpl() throws PDFFontException- Throws:
PDFFontException
-
PDFFontSetImpl
public PDFFontSetImpl(FontResolutionPriority priority) throws PDFFontException
Default constructor that provides no fonts.- Throws:
PDFFontException
-
PDFFontSetImpl
public PDFFontSetImpl(PDFFontSetImpl original) throws PDFFontException
- Throws:
PDFFontException
-
-
Method Detail
-
hasRootFallback
public boolean hasRootFallback() throws PDFFontExceptionDescription copied from interface:PDFFontSetReturns true if there is a "final fallback" font installed in ULocale.ROOT.- Specified by:
hasRootFallbackin interfacePDFFontSet- Throws:
PDFFontException
-
addFont
public void addFont(Font font, Platform platForm, ULocale locale) throws PDFFontException
Description copied from interface:PDFFontSetAdd a givenFontto thePDFFontSetfor use in font lookup. There is an inherent priority ordering based on the order thatFontobjects 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:
addFontin interfacePDFFontSet- 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:PDFFontSetAdd a givenFontto thePDFFontSet. The provided PostScript and CSS font descriptions will be used during font lookup. Either array of descriptions can be null. If theFont's native font descriptions are also desired, both this API andother addFont variantscan be called with the same Font instance. There is an inherent priority ordering based on the order thatFontobjects are added with earlier added fonts having higher priority.- Specified by:
addFontin interfacePDFFontSet- Throws:
PDFFontException
-
addFont
public void addFont(Font[] fonts, Platform platForm, ULocale locale) throws PDFFontException
Description copied from interface:PDFFontSetAdd an array ofFontobjects to thePDFFontSetfor 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:
addFontin interfacePDFFontSet- 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 PDFFontExceptionDescription copied from interface:PDFFontSetAdd a givenFontto thePDFFontSetfor 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:
addFallbackFontin interfacePDFFontSet- Parameters:
locale- the locale for which this fallback font should be usedfont- a non-null valid Font object- Throws:
PDFFontException
-
addFallbackFont
public void addFallbackFont(java.util.Locale locale, Font[] fonts) throws PDFFontExceptionDescription copied from interface:PDFFontSetAdd an array ofFontobjects to thePDFFontSetfor 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:
addFallbackFontin interfacePDFFontSet- Parameters:
locale- the locale for which this fallback font should be usedfonts- a non-null array of non-null valid Font objects- Throws:
PDFFontException
-
setGenericFontFamilyName
public void setGenericFontFamilyName(CSS20GenericFontFamily family, java.lang.String[] replacements) throws PDFFontException
Description copied from interface:PDFFontSetAn array of font family names to use as replacements for the generic CSS font family names. This array of font family names replaces any previously set names for the specific font family.- Specified by:
setGenericFontFamilyNamein interfacePDFFontSetreplacements- a non-null array of non-null valid String objects- Throws:
PDFFontException- See Also:
CSS20GenericFontFamily
-
getCSS20FontSet
public CSS20FontSet getCSS20FontSet() throws PDFFontException
Get the CSS20 fonts.- Returns:
- an object that provides access to a font set.
- Throws:
PDFFontException
-
getPSFontSet
public PSNameResolver getPSFontSet() throws PDFFontException
Get the PS fonts.- Returns:
- an object that provides access to a font set.
- Throws:
PDFFontException
-
getFallbackFontSet
public FallbackFontSet getFallbackFontSet() throws PDFFontException
Get the fallback fonts.- Specified by:
getFallbackFontSetin interfacePDFFontSet- Returns:
- an object that provides access to a font set.
- 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
-
getPSFont
public Font getPSFont(java.lang.String fontName, java.util.Locale locale, boolean substitute) throws PDFFontException
- Throws:
PDFFontException
-
setResolutionPriority
public void setResolutionPriority(FontResolutionPriority priority)
-
toString
public java.lang.String toString()
A debugging string containing information about the contents of thePDFFontSetImplinstance.- Overrides:
toStringin classjava.lang.Object
-
addFont
public void addFont(Font font) throws PDFFontException
Description copied from interface:PDFFontSetAdd a givenFontto thePDFFontSetfor use in font lookup. There is an inherent priority ordering based on the order thatFontobjects 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 callPDFFontSet.addFont(Font, Platform, ULocale).- Specified by:
addFontin interfacePDFFontSet- Parameters:
font- a non-null valid Font object- Throws:
PDFFontException
-
addFont
public void addFont(Font[] fonts) throws PDFFontException
Description copied from interface:PDFFontSetAdd an array ofFontobjects to thePDFFontSetfor 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 callPDFFontSet.addFont(Font[], Platform, ULocale).- Specified by:
addFontin interfacePDFFontSet- Parameters:
fonts- a non-null array of non-null valid Font objects- Throws:
PDFFontException
-
setIgnoreFontLoadingErrors
public void setIgnoreFontLoadingErrors(boolean ignoreFontLoadingErrors)
Description copied from interface:PDFFontSetSets if any error while adding font to fontset should be ignored- Specified by:
setIgnoreFontLoadingErrorsin interfacePDFFontSet
-
-