public abstract class Typeface extends Object implements FontMetrics
Modifier and Type | Field and Description |
---|---|
protected FontEventListener |
eventListener
An optional event listener that receives events such as missing glyphs etc.
|
static char |
NOT_FOUND
Code point that is used if no code point for a specific character has
been found.
|
Constructor and Description |
---|
Typeface() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getEncodingName()
Get the encoding of the font.
|
int |
getMaxAscent(int size)
Returns the maximum ascent of the font described by this
FontMetrics object.
|
boolean |
hadMappingOperations()
Indicates whether this font had to do any character mapping operations.
|
abstract boolean |
hasChar(char c)
Determines whether this font contains a particular character/glyph.
|
boolean |
hasFeature(int tableType,
String script,
String language,
String feature)
Determine if metrics supports specific feature in specified font table.
|
boolean |
isCID() |
boolean |
isMultiByte()
Determines whether the font is a multibyte font.
|
abstract char |
mapChar(char c)
Map a Unicode character to a code point in the font.
|
protected void |
notifyMapOperation()
Used for keeping track of character mapping operations in order to determine if a font
was used at all or not.
|
void |
setEventListener(FontEventListener listener)
Sets the font event listener that can be used to receive events about particular events
in this class.
|
String |
toString() |
protected void |
warnMissingGlyph(char c)
Provide proper warning if a glyph is not available.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAscender, getBoundingBox, getCapHeight, getDescender, getEmbedFontName, getFamilyNames, getFontName, getFontType, getFontURI, getFullName, getKerningInfo, getStrikeoutPosition, getStrikeoutThickness, getUnderlinePosition, getUnderlineThickness, getWidth, getWidths, getXHeight, hasKerningInfo
public static final char NOT_FOUND
protected FontEventListener eventListener
public abstract String getEncodingName()
public abstract char mapChar(char c)
c
- character to mapprotected void notifyMapOperation()
public boolean hadMappingOperations()
public abstract boolean hasChar(char c)
c
- character to checkpublic boolean isMultiByte()
isMultiByte
in interface FontMetrics
public boolean isCID()
public int getMaxAscent(int size)
getMaxAscent
in interface FontMetrics
size
- font sizepublic boolean hasFeature(int tableType, String script, String language, String feature)
hasFeature
in interface FontMetrics
tableType
- type of table (GSUB, GPOS, ...), see GlyphTable.GLYPH_TABLE_TYPE_*script
- to qualify feature lookuplanguage
- to qualify feature lookupfeature
- to testpublic void setEventListener(FontEventListener listener)
listener
- the font event listenerprotected void warnMissingGlyph(char c)
c
- the character which is missing.Copyright © 2025 Apache Software Foundation. All rights reserved.