Abstract base class for custom fonts loaded from files, for example.
getEmbedFileName
public String getEmbedFileName()
Returns an URI representing an embeddable font file. The URI will often
be a filename or an URL.
- URI to an embeddable font file or null if not available.
getEmbedFileSource
public Source getEmbedFileSource()
throws IOException
Returns a Source representing an embeddable font file.
- Source for an embeddable font file
getEmbedResourceName
public String getEmbedResourceName()
Returns the lookup name to an embeddable font file available as a
resource.
(todo) Remove this method, this should be done using a resource: URI.
getFamilyNames
public Set getFamilyNames()
Returns the font family names.
- getFamilyNames in interface FontMetrics
- the font family names (a Set of Strings)
getFirstChar
public int getFirstChar()
Returns the index of the first character defined in this font.
- the index of the first character
getFontSubName
public String getFontSubName()
Returns font's subfamily name.
- the font's subfamily name
getLastChar
public int getLastChar()
Returns the index of the last character defined in this font.
- the index of the last character
getMissingWidth
public int getMissingWidth()
Returns the width to be used when no width is available.
getStrippedFontName
public String getStrippedFontName()
Returns the font family name stripped of whitespace.
getWeight
public int getWeight()
Returns the font weight (100, 200...800, 900). This value may be different from the
one that was actually used to register the font.
- the font weight (or 0 if the font weight is unknown)
isKerningEnabled
public boolean isKerningEnabled()
Used to determine if kerning is enabled.
- True if kerning is enabled.
replaceKerningMap
public void replaceKerningMap(Map kerningMap)
Replaces the existing kerning map with a new one.
kerningMap
- the kerning map (Map, the integers are
character codes)
setFontSubFamilyName
public void setFontSubFamilyName(String subFamilyName)
Sets the font's subfamily name.
subFamilyName
- the subfamily name of the font
setResolver
public void setResolver(FontResolver resolver)
Sets the font resolver. Needed for URI resolution.
resolver
- the font resolver
setWeight
public void setWeight(int weight)
Sets the font weight. Valid values are 100, 200...800, 900.
setXHeight
public void setXHeight(int xHeight)
Returns the XHeight value of the font.
xHeight
- the XHeight value