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 void
addFallbackFont(java.util.Locale locale, Font font)
Add a givenFont
to thePDFFontSet
for use as a fallback font for the given locale.void
addFallbackFont(java.util.Locale locale, Font[] fonts)
Add an array ofFont
objects to thePDFFontSet
for use as a fallback font for the given locale.void
addFont(Font font)
Add a givenFont
to thePDFFontSet
for use in font lookup.void
addFont(Font[] fonts)
Add an array ofFont
objects to thePDFFontSet
for use in font lookup.void
addFont(Font[] fonts, Platform platForm, ULocale locale)
Add an array ofFont
objects to thePDFFontSet
for use in font lookup.void
addFont(Font font, Platform platForm, ULocale locale)
Add a givenFont
to thePDFFontSet
for use in font lookup.void
addFont(Font font, PostscriptFontDescription[] psDescriptions, CSS20FontDescription[] cssDescriptions)
Add a givenFont
to thePDFFontSet
.CSS20FontSet
getCSS20FontSet()
Get the CSS20 fonts.Font
getFallbackFont(java.util.Locale locale)
Gets the preferred fallback font for locale suppliedFallbackFontSet
getFallbackFontSet()
Get the fallback fonts.Font
getPSFont(PostscriptFontDescription fontDescription, java.util.Locale locale, boolean substitute)
Get the PS fonts.Font
getPSFont(java.lang.String fontName, java.util.Locale locale, boolean substitute)
PSNameResolver
getPSFontSet()
Get the PS fonts.boolean
hasRootFallback()
Returns true if there is a "final fallback" font installed in ULocale.ROOT.void
setGenericFontFamilyName(CSS20GenericFontFamily family, java.lang.String[] replacements)
An array of font family names to use as replacements for the generic CSS font family names.void
setIgnoreFontLoadingErrors(boolean ignoreFontLoadingErrors)
Sets if any error while adding font to fontset should be ignoredvoid
setResolutionPriority(FontResolutionPriority priority)
java.lang.String
toString()
A debugging string containing information about the contents of thePDFFontSetImpl
instance.
-
-
-
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 PDFFontException
Description copied from interface:PDFFontSet
Returns true if there is a "final fallback" font installed in ULocale.ROOT.- Specified by:
hasRootFallback
in interfacePDFFontSet
- Throws:
PDFFontException
-
addFont
public void addFont(Font font, Platform platForm, ULocale locale) throws PDFFontException
Description copied from interface:PDFFontSet
Add a givenFont
to thePDFFontSet
for use in font lookup. There is an inherent priority ordering based on the order thatFont
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 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:PDFFontSet
Add a givenFont
to 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 variants
can be called with the same Font instance. There is an inherent priority ordering based on the order thatFont
objects are added with earlier added fonts having higher priority.- Specified by:
addFont
in interfacePDFFontSet
- Throws:
PDFFontException
-
addFont
public void addFont(Font[] fonts, Platform platForm, ULocale locale) throws PDFFontException
Description copied from interface:PDFFontSet
Add an array ofFont
objects to thePDFFontSet
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 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 PDFFontException
Description copied from interface:PDFFontSet
Add a givenFont
to thePDFFontSet
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 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 PDFFontException
Description copied from interface:PDFFontSet
Add an array ofFont
objects to thePDFFontSet
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 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:PDFFontSet
An 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:
setGenericFontFamilyName
in interfacePDFFontSet
replacements
- 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:
getFallbackFontSet
in 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 thePDFFontSetImpl
instance.- Overrides:
toString
in classjava.lang.Object
-
addFont
public void addFont(Font font) throws PDFFontException
Description copied from interface:PDFFontSet
Add a givenFont
to thePDFFontSet
for use in font lookup. There is an inherent priority ordering based on the order thatFont
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 callPDFFontSet.addFont(Font, Platform, ULocale)
.- Specified by:
addFont
in interfacePDFFontSet
- 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 ofFont
objects to thePDFFontSet
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 callPDFFontSet.addFont(Font[], Platform, ULocale)
.- Specified by:
addFont
in 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:PDFFontSet
Sets if any error while adding font to fontset should be ignored- Specified by:
setIgnoreFontLoadingErrors
in interfacePDFFontSet
-
-