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 TypeMethodDescriptionvoidAdds 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).voidaddFont(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).booleanfindFont(CSS20Attribute attributes, ULocale locale) Search for a font using the same search as would used by a layout engine using this fontset.inthashCode()booleanisEmpty()Tests if the CSS20FontSet has had no fonts added.voidsetFallbackFonts(FallbackFontSet fallbackFontSet) Set the fallback fonts.voidsetGenericFont(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 theCSS20FontSetshould 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, restoreOriginalFontSetMethods 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:CSS20FontSetSet the resolution mechanism that theCSS20FontSetshould 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#FIRSTFontResolutionPriority#INTELLIGENTspecifies that an "intelligent" determination is made about the fonts and the one that "best" represents the CSS attributes where they collide is chosen.FontResolutionPriority#FIRSTspecifies the first font added to the font set that matches the CSS attributes is chosen.FontResolutionPriority#LASTspecifies the last font added to the font set that matches the CSS attributes is chosen.- Specified by:
setResolutionPriorityin 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:CSS20FontSetAdds 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:
addFontin interfaceCSS20FontSet- Parameters:
font- the font to add to the fonts used for CSS resolution- Throws:
InvalidFontExceptionUnsupportedFontExceptionFontLoadingException
-
addFont
public void addFont(CSS20FontDescription fontDesc, Font font) throws InvalidFontException, UnsupportedFontException, FontLoadingException Description copied from interface:CSS20FontSetAdds 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:
addFontin interfaceCSS20FontSet- Parameters:
fontDesc- the CSS properties to use for this fontfont- the font to add to the fonts used for CSS resolution- Throws:
InvalidFontExceptionUnsupportedFontExceptionFontLoadingException
-
isEmpty
public boolean isEmpty()Description copied from interface:CSS20FontSetTests if the CSS20FontSet has had no fonts added. It does not check the fallback or generic fonts.- Specified by:
isEmptyin interfaceCSS20FontSet- Returns:
- True if the
CSS20FontSetis empty (has no fonts).
-
setGenericFont
Description copied from interface:CSS20FontSetSet the list of replacement font family names for the specified CSS generic font family.- Specified by:
setGenericFontin interfaceCSS20FontSet- Parameters:
genericFamily- the CSS generic font family to assign the replacement fonts to.replacementFontNames- a List ofStringobjects with the replacement font family names.- See Also:
-
setFallbackFonts
Description copied from interface:CSS20FontSetSet the fallback fonts.- Specified by:
setFallbackFontsin interfaceCSS20FontSet- Parameters:
fallbackFontSet- search the fonts in this set when none of the fonts added by theaddFontmethods are suitable.
-
findFont
Description copied from interface:CSS20FontSetSearch 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:
findFontin 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
-