Class CSS20FontDatabase
- java.lang.Object
-
- com.adobe.fontengine.fontmanagement.FontSetStack
-
- com.adobe.fontengine.inlineformatting.css20.CSS20FontDatabase
-
- All Implemented Interfaces:
CSS20FontSet,java.io.Serializable
public final class CSS20FontDatabase extends FontSetStack implements CSS20FontSet
CSS20FontDatabase- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CSS20FontDatabase()CSS20FontDatabase(boolean ignoreVariant)CSS20FontDatabase(CSS20FontDatabase original)Copy Constructor.CSS20FontDatabase(FamilyNameNormalizer normalizer)CSS20FontDatabase(FamilyNameNormalizer normalizer, boolean ignoreVariant)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFont(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)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).booleanequals(java.lang.Object obj)FontfindFont(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, java.lang.String[] replacementFontNames)Set the list of replacement font family names for the specified CSS generic font family.FontResolutionPrioritysetResolutionPriority(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.java.lang.StringtoString()-
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 Detail
-
CSS20FontDatabase
public CSS20FontDatabase()
-
CSS20FontDatabase
public CSS20FontDatabase(boolean ignoreVariant)
-
CSS20FontDatabase
public CSS20FontDatabase(FamilyNameNormalizer normalizer)
-
CSS20FontDatabase
public CSS20FontDatabase(FamilyNameNormalizer normalizer, boolean ignoreVariant)
-
CSS20FontDatabase
public CSS20FontDatabase(CSS20FontDatabase original)
Copy Constructor.
-
-
Method Detail
-
setResolutionPriority
public FontResolutionPriority setResolutionPriority(FontResolutionPriority priority)
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
public void setGenericFont(CSS20GenericFontFamily genericFamily, java.lang.String[] replacementFontNames)
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:
CSS20GenericFontFamily
-
setFallbackFonts
public void setFallbackFonts(FallbackFontSet fallbackFontSet)
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
public Font findFont(CSS20Attribute attributes, ULocale locale) throws FontException
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
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-