Class CSS20FontDatabase
java.lang.Object
com.adobe.fontengine.fontmanagement.FontSetStack
com.adobe.fontengine.inlineformatting.css20.CSS20FontDatabase
- All Implemented Interfaces:
CSS20FontSet
,Serializable
CSS20FontDatabase
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCSS20FontDatabase
(boolean ignoreVariant) CSS20FontDatabase
(CSS20FontDatabase original) Copy Constructor.CSS20FontDatabase
(FamilyNameNormalizer normalizer) CSS20FontDatabase
(FamilyNameNormalizer normalizer, boolean ignoreVariant) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 inPDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)
orPDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int, boolean)
.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 inPDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)
andPDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int, boolean)
.boolean
findFont
(CSS20Attribute attributes, ULocale locale) Search for a font using the same search as would used by a layout engine using this fontset.int
hashCode()
boolean
isEmpty()
Tests if the CSS20FontSet has had no fonts added.void
setFallbackFonts
(FallbackFontSet fallbackFontSet) 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.setResolutionPriority
(FontResolutionPriority priority) Set the resolution mechanism that theCSS20FontSet
should use to decide which font should be chosen when two fonts appear identical under the CSS font selection algorithm.toString()
Methods inherited from class com.adobe.fontengine.fontmanagement.FontSetStack
flattenFontSet, popFontSet, pushFontSet, restoreOriginalFontSet
Methods inherited from interface com.adobe.fontengine.inlineformatting.css20.CSS20FontSet
flattenFontSet, popFontSet, pushFontSet, restoreOriginalFontSet
-
Constructor Details
-
CSS20FontDatabase
public CSS20FontDatabase() -
CSS20FontDatabase
public CSS20FontDatabase(boolean ignoreVariant) -
CSS20FontDatabase
-
CSS20FontDatabase
-
CSS20FontDatabase
Copy Constructor.
-
-
Method Details
-
setResolutionPriority
Description copied from interface:CSS20FontSet
Set the resolution mechanism that theCSS20FontSet
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 isFontResolutionPriority#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.- Specified by:
setResolutionPriority
in interfaceCSS20FontSet
- Parameters:
priority
- The resolution mechanism to use- Returns:
- The old resolution priority setting.
-
addFont
public void addFont(Font font) throws InvalidFontException, UnsupportedFontException, FontLoadingException Description copied from interface:CSS20FontSet
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 inPDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)
orPDF16RichTextFormatter.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 ofCSS20FontSet.setResolutionPriority(com.adobe.fontengine.fontmanagement.FontResolutionPriority)
.- Specified by:
addFont
in interfaceCSS20FontSet
- Parameters:
font
- the font to add to the fonts used for CSS resolution- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
addFont
public void addFont(CSS20FontDescription fontDesc, Font font) throws InvalidFontException, UnsupportedFontException, FontLoadingException Description copied from interface:CSS20FontSet
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 inPDF16RichTextFormatter.format(com.adobe.fontengine.inlineformatting.AttributedRun, int, int)
andPDF16RichTextFormatter.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 ofCSS20FontSet.setResolutionPriority(com.adobe.fontengine.fontmanagement.FontResolutionPriority)
. The CSS attributes of the font are ignored and those provided are used instead.- Specified by:
addFont
in interfaceCSS20FontSet
- Parameters:
fontDesc
- the CSS properties to use for this fontfont
- the font to add to the fonts used for CSS resolution- Throws:
InvalidFontException
UnsupportedFontException
FontLoadingException
-
isEmpty
public boolean isEmpty()Description copied from interface:CSS20FontSet
Tests if the CSS20FontSet has had no fonts added. It does not check the fallback or generic fonts.- Specified by:
isEmpty
in interfaceCSS20FontSet
- Returns:
- True if the
CSS20FontSet
is empty (has no fonts).
-
setGenericFont
Description copied from interface:CSS20FontSet
Set the list of replacement font family names for the specified CSS generic font family.- Specified by:
setGenericFont
in interfaceCSS20FontSet
- Parameters:
genericFamily
- the CSS generic font family to assign the replacement fonts to.replacementFontNames
- a List ofString
objects with the replacement font family names.- See Also:
-
setFallbackFonts
Description copied from interface:CSS20FontSet
Set the fallback fonts.- Specified by:
setFallbackFonts
in interfaceCSS20FontSet
- Parameters:
fallbackFontSet
- search the fonts in this set when none of the fonts added by theaddFont
methods are suitable.
-
findFont
Description copied from interface:CSS20FontSet
Search for a font using the same search as would used by a layout engine using this fontset. Only the first font that would be found using this search is returned. If the CSS 2.0 attributes used for the search don't lead to a font in the fontset then the locale is used to search the fallback fonts for a match.- Specified by:
findFont
in interfaceCSS20FontSet
- Parameters:
attributes
- the CSS 2.0 attributes to search forlocale
- the locale for the font search- Returns:
- the font found using the CSS 2.0 search algorithm
- Throws:
FontException
-
equals
-
hashCode
public int hashCode() -
toString
-