Class PlatformFontResolverImpl
- java.lang.Object
-
- com.adobe.fontengine.fontmanagement.platform.PlatformFontResolverImpl
-
- All Implemented Interfaces:
PlatformFontResolver
,java.io.Serializable
public class PlatformFontResolverImpl extends java.lang.Object implements PlatformFontResolver
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PlatformFontResolverImpl()
PlatformFontResolverImpl(PlatformFontResolverImpl original)
PlatformFontResolverImpl(FamilyNameNormalizer normalizer)
-
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 of platform names.void
addFont(PlatformFontDescription fontDesc, Font font)
Adds a font to the set of fonts that are examined for resolving of platform names.boolean
equals(java.lang.Object obj)
Font
findFont(PlatformFontSearchAttributes searchAttributes)
Find a Font that matches the provided description.int
hashCode()
boolean
isEmpty()
FontResolutionPriority
setResolutionPriority(FontResolutionPriority priority)
Set the resolution mechanism that the PlatformNameResoulver should use to decide which font should be chosen when two fonts have the same platform name.java.lang.String
toString()
-
-
-
Constructor Detail
-
PlatformFontResolverImpl
public PlatformFontResolverImpl()
-
PlatformFontResolverImpl
public PlatformFontResolverImpl(FamilyNameNormalizer normalizer)
-
PlatformFontResolverImpl
public PlatformFontResolverImpl(PlatformFontResolverImpl original)
-
-
Method Detail
-
addFont
public void addFont(Font font) throws UnsupportedFontException, InvalidFontException, FontLoadingException
Description copied from interface:PlatformFontResolver
Adds a font to the set of fonts that are examined for resolving of platform names. If this font is indistinguishable from another font already in the font set then which of the two that is kept is determined by the settings ofFontResolutionPriority
.- Specified by:
addFont
in interfacePlatformFontResolver
- Parameters:
font
- the font to add to the fonts used for platform resolution- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
addFont
public void addFont(PlatformFontDescription fontDesc, Font font) throws UnsupportedFontException, InvalidFontException, FontLoadingException
Description copied from interface:PlatformFontResolver
Adds a font to the set of fonts that are examined for resolving of platform names. If this font's PlatformFontDescription is indistinguishable from another font already in the font set then which of the two that is kept is determined by the settings ofFontResolutionPriority
.Note that the PlatformFontDescription is NOT pushed down into the Font. It is only an alias in the database. Thus, calling
font.getPostscriptFontDescription()
will not return the description passed in through this method but will instead return the original platform description of the font.- Specified by:
addFont
in interfacePlatformFontResolver
- Parameters:
fontDesc
- the platform description of the fontfont
- the font to add to the fonts used for platform resolution- Throws:
UnsupportedFontException
InvalidFontException
FontLoadingException
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePlatformFontResolver
- Returns:
true
if the font set is empty (has no fonts);false
otherwise
-
setResolutionPriority
public FontResolutionPriority setResolutionPriority(FontResolutionPriority priority)
Description copied from interface:PlatformFontResolver
Set the resolution mechanism that the PlatformNameResoulver should use to decide which font should be chosen when two fonts have the same platform name.FontResolutionPriority.INTELLIGENT_FIRST
specifies that an "intelligent" determination is made about the fonts and the "better" of the two font is chosen. If the "intelligent" resolver can make no distinction between the fonts then the first font to have been added first is chosen.FontResolutionPriority.INTELLIGENT_LAST
specifies that an "intelligent" determination is made about the fonts and the "better" of the two font is chosen. If the "intelligent" resolver can make no distinction between the fonts then the first font to have been added last is chosen.FontResolutionPriority.FIRST
specifies the first font added to the font set that matches the platform attributes is chosen.FontResolutionPriority.LAST
specifies the last font added to the font set that matches the platform attributes is chosen.- Specified by:
setResolutionPriority
in interfacePlatformFontResolver
- Parameters:
priority
- The resolution mechanism to use- Returns:
- The old resolution priority setting.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
findFont
public Font findFont(PlatformFontSearchAttributes searchAttributes)
Description copied from interface:PlatformFontResolver
Find a Font that matches the provided description. No analysis (e.g., removal of a CMap extension) is done by this function.- Specified by:
findFont
in interfacePlatformFontResolver
- Parameters:
searchAttributes
- the platform font attributes to search for- Returns:
- the Font.
-
-