public abstract class CustomFont extends Typeface implements FontDescriptor, MutableFont
eventListener, NOT_FOUND
Constructor and Description |
---|
CustomFont() |
Modifier and Type | Method and Description |
---|---|
int |
getAscender()
Returns the ascender value of the font.
|
int |
getAscender(int size)
Returns the ascent of the font described by this
FontMetrics object.
|
int |
getCapHeight()
Returns the capital height of the font.
|
int |
getCapHeight(int size)
Returns the size of a capital letter measured from the font's baseline.
|
int |
getDescender()
Returns the descender value of the font.
|
int |
getDescender(int size)
Returns the descent of the font described by this
FontMetrics object.
|
String |
getEmbedFileName()
Returns an URI representing an embeddable font file.
|
Source |
getEmbedFileSource()
Returns a Source representing an embeddable font file.
|
String |
getEmbedFontName()
Returns the font name for font embedding (may include a prefix, Example: "1E28bcArialMT").
|
String |
getEmbedResourceName()
Returns the lookup name to an embeddable font file available as a
resource.
|
Set |
getFamilyNames()
Returns the font family names.
|
int |
getFirstChar()
Returns the index of the first character defined in this font.
|
int |
getFlags()
Returns the flags for the font.
|
int[] |
getFontBBox()
Returns the font's bounding box.
|
String |
getFontName()
Returns the "PostScript" font name (Example: "Helvetica-BoldOblique").
|
String |
getFontSubName()
Returns font's subfamily name.
|
FontType |
getFontType()
Returns the type of the font.
|
String |
getFullName()
Returns the font's full name (Example: "Helvetica Bold Oblique").
|
int |
getItalicAngle()
Returns the italic angle for the font.
|
Map |
getKerningInfo()
Returns the kerning map for the font.
|
int |
getLastChar()
Returns the index of the last character defined in this font.
|
int |
getMissingWidth()
Returns the width to be used when no width is available.
|
Panose |
getPanose() |
int |
getStemV()
Returns the vertical stem width for the font.
|
String |
getStrippedFontName()
Returns the font family name stripped of whitespace.
|
int |
getWeight()
Returns the font weight (100, 200...800, 900).
|
int |
getXHeight(int size)
Determines the typical font height of this
FontMetrics object
|
boolean |
hasKerningInfo()
Indicates if the font has kering information.
|
boolean |
isEmbeddable()
Indicates if this font may be embedded.
|
boolean |
isKerningEnabled()
Used to determine if kerning is enabled.
|
boolean |
isSymbolicFont()
Indicates whether the font is a symbolic font.
|
void |
putKerningEntry(Integer key,
Map value)
Adds an entry to the kerning table.
|
void |
replaceKerningMap(Map kerningMap)
Replaces the existing kerning map with a new one.
|
void |
setAscender(int ascender)
Sets the ascent value.
|
void |
setCapHeight(int capHeight)
Sets the capital height value.
|
void |
setDescender(int descender)
Sets the descent value.
|
void |
setEmbeddable(boolean isEmbeddable) |
void |
setEmbedFileName(String path)
Sets the path to the embeddable font file.
|
void |
setEmbedResourceName(String name)
Sets the resource name of the embeddable font file.
|
void |
setFamilyNames(Set names)
Sets the font's family names (Example: "Helvetica").
|
void |
setFirstChar(int index)
Sets the index of the first character in the character table.
|
void |
setFlags(int flags)
Sets the font's flags
|
void |
setFontBBox(int[] bbox)
Sets the font's bounding box
|
void |
setFontName(String name)
Sets the "PostScript" font name (Example: "Helvetica-BoldOblique").
|
void |
setFontSubFamilyName(String subFamilyName)
Sets the font's subfamily name.
|
void |
setFontType(FontType fontType)
Sets the font type.
|
void |
setFullName(String name)
Sets the font's full name (usually the one that the operating system displays).
|
void |
setItalicAngle(int italicAngle)
Sets the font's italic angle.
|
void |
setKerningEnabled(boolean enabled)
Enables/disabled kerning.
|
void |
setLastChar(int index)
Sets the index of the last character in the character table.
|
void |
setMissingWidth(int width)
Sets the font's default width
|
void |
setPanose(Panose panose) |
void |
setResolver(FontResolver resolver)
Sets the font resolver.
|
void |
setStemV(int stemV)
Sets the font's StemV value.
|
void |
setWeight(int weight)
Sets the font weight.
|
void |
setXHeight(int xHeight)
Returns the XHeight value of the font.
|
getEncodingName, getMaxAscent, hadMappingOperations, hasChar, isMultiByte, mapChar, notifyMapOperation, setEventListener, toString, warnMissingGlyph
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMaxAscent, getWidth, getWidths
public boolean isEmbeddable()
FontDescriptor
isEmbeddable
in interface FontDescriptor
public void setEmbeddable(boolean isEmbeddable)
public Panose getPanose()
public void setPanose(Panose panose)
public String getFontName()
getFontName
in interface FontMetrics
public String getEmbedFontName()
getEmbedFontName
in interface FontMetrics
public String getFullName()
getFullName
in interface FontMetrics
public Set getFamilyNames()
getFamilyNames
in interface FontMetrics
public String getStrippedFontName()
FontUtil.stripWhiteSpace(String)
public String getFontSubName()
public String getEmbedFileName()
public Source getEmbedFileSource() throws IOException
IOException
- if embedFileName is not null but Source is not foundpublic String getEmbedResourceName()
public int getAscender()
getAscender
in interface FontDescriptor
public int getDescender()
getDescender
in interface FontDescriptor
public int getCapHeight()
getCapHeight
in interface FontDescriptor
public int getAscender(int size)
getAscender
in interface FontMetrics
size
- font sizepublic int getDescender(int size)
getDescender
in interface FontMetrics
size
- font sizepublic int getCapHeight(int size)
getCapHeight
in interface FontMetrics
size
- font sizepublic int getXHeight(int size)
getXHeight
in interface FontMetrics
size
- font sizepublic int[] getFontBBox()
getFontBBox
in interface FontDescriptor
public int getFlags()
getFlags
in interface FontDescriptor
public boolean isSymbolicFont()
isSymbolicFont
in interface FontDescriptor
public int getWeight()
public int getStemV()
getStemV
in interface FontDescriptor
public int getItalicAngle()
getItalicAngle
in interface FontDescriptor
public int getMissingWidth()
public FontType getFontType()
getFontType
in interface FontMetrics
public int getFirstChar()
public int getLastChar()
public boolean isKerningEnabled()
public final boolean hasKerningInfo()
hasKerningInfo
in interface FontMetrics
public final Map getKerningInfo()
getKerningInfo
in interface FontMetrics
public void setFontName(String name)
setFontName
in interface MutableFont
name
- font namepublic void setFullName(String name)
setFullName
in interface MutableFont
name
- font' full namepublic void setFamilyNames(Set names)
setFamilyNames
in interface MutableFont
names
- the font's family names (a Set of Strings)public void setFontSubFamilyName(String subFamilyName)
subFamilyName
- the subfamily name of the fontpublic void setEmbedFileName(String path)
setEmbedFileName
in interface MutableFont
path
- URI to the filepublic void setEmbedResourceName(String name)
setEmbedResourceName
in interface MutableFont
name
- resource namepublic void setCapHeight(int capHeight)
setCapHeight
in interface MutableFont
capHeight
- capital heightpublic void setXHeight(int xHeight)
xHeight
- the XHeight valuepublic void setAscender(int ascender)
setAscender
in interface MutableFont
ascender
- ascent heightpublic void setDescender(int descender)
setDescender
in interface MutableFont
descender
- descent valuepublic void setFontBBox(int[] bbox)
setFontBBox
in interface MutableFont
bbox
- bounding boxpublic void setFlags(int flags)
setFlags
in interface MutableFont
flags
- flagspublic void setWeight(int weight)
weight
- the font weightpublic void setStemV(int stemV)
setStemV
in interface MutableFont
stemV
- StemVpublic void setItalicAngle(int italicAngle)
setItalicAngle
in interface MutableFont
italicAngle
- italic anglepublic void setMissingWidth(int width)
setMissingWidth
in interface MutableFont
width
- default widthpublic void setFontType(FontType fontType)
setFontType
in interface MutableFont
fontType
- font typepublic void setFirstChar(int index)
setFirstChar
in interface MutableFont
index
- index of first characterpublic void setLastChar(int index)
setLastChar
in interface MutableFont
index
- index of the last characterpublic void setKerningEnabled(boolean enabled)
setKerningEnabled
in interface MutableFont
enabled
- True if kerning should be enabled if availablepublic void setResolver(FontResolver resolver)
resolver
- the font resolverpublic void putKerningEntry(Integer key, Map value)
putKerningEntry
in interface MutableFont
key
- Kerning keyvalue
- Kerning valuepublic void replaceKerningMap(Map kerningMap)
kerningMap
- the kerning map (MapCopyright © 2007-2019. All Rights Reserved.