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 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 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
equals(java.lang.Object obj)
Font
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, java.lang.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 theCSS20FontSet
should use to decide which font should be chosen when two fonts appear identical under the CSS font selection algorithm.java.lang.String
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 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: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
public void setGenericFont(CSS20GenericFontFamily genericFamily, java.lang.String[] replacementFontNames)
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:
CSS20GenericFontFamily
-
setFallbackFonts
public void setFallbackFonts(FallbackFontSet fallbackFontSet)
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
public Font findFont(CSS20Attribute attributes, ULocale locale) throws FontException
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
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-