public interface CSS20FontSet extends Serializable
PDF16RichTextFormatter object
to resolve CSS font specifications into actual FontData objects.
CSS20FontSet objects implement the Serializable interface. The intent is that CSS20FontSets would generally
not be entirely regenerated from scratch. Instead, they would be deserialized.
| Modifier and Type | Method and Description |
|---|---|
void |
addFont(CSS20FontDescription fontDesc,
Font font)
Adds a font to the set of fonts that are examined for resolving a set of
CSS attributes into an actual font during the formatting process in
PDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)
and PDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int, boolean). |
void |
addFont(Font font)
Adds a font to the set of fonts that are examined for resolving a set of
CSS attributes into an actual font during the formatting process in
PDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)
or PDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int, boolean). |
Font |
findFont(CSS20Attribute attributes,
ULocale locale)
Search for a font using the same search as would used by a layout engine using
this fontset.
|
void |
flattenFontSet()
Flatten the fontset so that any state information is removed and any fonts that
have been added to the fontset are "permanent".
|
boolean |
isEmpty()
Tests if the CSS20FontSet has had no fonts added.
|
void |
popFontSet()
Pop the state of the fontset so that fonts that were added after the last push operation
are removed and no longer available for use.
|
void |
pushFontSet()
Push the current state of the fontset so that fonts added after this can be removed
by popping the fontset to original state.
|
void |
restoreOriginalFontSet()
This is equivalent to calling
popFontSet() as many times as pushFontSet()
has already been called. |
void |
setFallbackFonts(FallbackFontSet ffs)
Set the fallback fonts.
|
void |
setGenericFont(CSS20GenericFontFamily genericFamily,
String[] replacementFontNames)
Set the list of replacement font family names for the specified CSS generic font family.
|
FontResolutionPriority |
setResolutionPriority(FontResolutionPriority priority)
Set the resolution mechanism that the
CSS20FontSet should use to decide which
font should be chosen when two fonts appear identical under the CSS font selection
algorithm. |
FontResolutionPriority setResolutionPriority(FontResolutionPriority priority)
CSS20FontSet should use to decide which
font should be chosen when two fonts appear identical under the CSS font selection
algorithm. The default resolution priority if none is specified is
FontResolutionPriority#FIRST
FontResolutionPriority#INTELLIGENT specifies
that an "intelligent" determination is made about the fonts and the one that "best"
represents the CSS attributes where they collide is chosen.
FontResolutionPriority#FIRST specifies
the first font added to the font set that matches the CSS attributes is chosen.
FontResolutionPriority#LAST specifies
the last font added to the font set that matches the CSS attributes is chosen.
priority - The resolution mechanism to usevoid addFont(Font font) throws UnsupportedFontException, InvalidFontException, FontLoadingException
PDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)
or PDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int, boolean). If this
font is indistinguisable from another font already in the font set then which
of the two that is preferred is determined by the settings of
setResolutionPriority(com.adobe.fontengine.fontmanagement.FontResolutionPriority).font - the font to add to the fonts used for CSS resolutionUnsupportedFontExceptionInvalidFontExceptionFontLoadingExceptionvoid addFont(CSS20FontDescription fontDesc, Font font) throws UnsupportedFontException, InvalidFontException, FontLoadingException
PDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)
and PDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int, boolean). If this
font is indistinguisable from another font already in the font set then which
of the two that is preferred is determined by the settings of
setResolutionPriority(com.adobe.fontengine.fontmanagement.FontResolutionPriority). The
CSS attributes of the font are ignored and those provided are used instead.fontDesc - the CSS properties to use for this fontfont - the font to add to the fonts used for CSS resolutionUnsupportedFontExceptionInvalidFontExceptionFontLoadingExceptionboolean isEmpty()
CSS20FontSet is empty (has no fonts).void setGenericFont(CSS20GenericFontFamily genericFamily, String[] replacementFontNames)
genericFamily - the CSS generic font family to assign the replacement fonts to.replacementFontNames - a List of String objects with the
replacement font family names.CSS20GenericFontFamilyvoid setFallbackFonts(FallbackFontSet ffs)
ffs - search the fonts in this set when none of the fonts added
by the addFont methods are suitable.Font findFont(CSS20Attribute attributes, ULocale locale) throws FontException
attributes - the CSS 2.0 attributes to search forlocale - the locale for the font searchFontExceptionvoid pushFontSet()
void popFontSet()
void restoreOriginalFontSet()
popFontSet() as many times as pushFontSet()
has already been called. It will restore the fontset to the state it was in before the
first push operation.
The push and pop operations only affect the basic fonts added and it does not
change any locale fallback fonts, generic fonts, or resolution priority.void flattenFontSet()
Copyright © 2010 - 2020 Adobe. All Rights Reserved