Interface PDFFontSet
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
PDFFontSetImpl
public interface PDFFontSet extends java.io.Serializable
This interface provides access to the methods that a client can use to build a font set that is used by in the formatting of text within a PDF document. PDFFontSet objects implement the Serializable interface. The intent is that PDFFontSet objects would generally not be entirely regenerated from scratch. Instead, they would be deserialized.
-
-
Method Summary
All Methods Instance Methods Abstract 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
.FallbackFontSet
getFallbackFontSet()
Returns the set of fallback fonts added to this font set.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 ignored
-
-
-
Method Detail
-
hasRootFallback
boolean hasRootFallback() throws PDFFontException
Returns true if there is a "final fallback" font installed in ULocale.ROOT.- Throws:
PDFFontException
-
addFont
void addFont(Font font) throws PDFFontException
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 calladdFont(Font, Platform, ULocale)
.- Parameters:
font
- a non-null valid Font object- Throws:
PDFFontException
-
addFont
void addFont(Font font, Platform platForm, ULocale locale) throws PDFFontException
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.- Parameters:
font
- a non-null valid Font object- Throws:
PDFFontException
-
addFont
void addFont(Font font, PostscriptFontDescription[] psDescriptions, CSS20FontDescription[] cssDescriptions) throws PDFFontException
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.- Throws:
PDFFontException
-
addFont
void addFont(Font[] fonts) throws PDFFontException
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 calladdFont(Font[], Platform, ULocale)
.- Parameters:
fonts
- a non-null array of non-null valid Font objects- Throws:
PDFFontException
-
addFont
void addFont(Font[] fonts, Platform platForm, ULocale locale) throws PDFFontException
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.- Parameters:
fonts
- a non-null array of non-null valid Font objects- Throws:
PDFFontException
-
addFallbackFont
void addFallbackFont(java.util.Locale locale, Font font) throws PDFFontException
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.- Parameters:
locale
- the locale for which this fallback font should be usedfont
- a non-null valid Font object- Throws:
PDFFontException
-
addFallbackFont
void addFallbackFont(java.util.Locale locale, Font[] fonts) throws PDFFontException
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.- 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
void setGenericFontFamilyName(CSS20GenericFontFamily family, java.lang.String[] replacements) throws PDFFontException
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.- Parameters:
family
-replacements
- a non-null array of non-null valid String objects- Throws:
PDFFontException
- See Also:
CSS20GenericFontFamily
-
getFallbackFontSet
FallbackFontSet getFallbackFontSet() throws PDFFontException
Returns the set of fallback fonts added to this font set.- Returns:
- The set of fallback fonts added to this font set.
- Throws:
PDFFontException
-
setIgnoreFontLoadingErrors
void setIgnoreFontLoadingErrors(boolean ignoreFontLoadingErrors)
Sets if any error while adding font to fontset should be ignored- Parameters:
ignoreFontLoadingErrors
-
-
-