Represents the contents of a Type 1 AFM font metrics file.
addCharMetrics
public void addCharMetrics(AFMCharMetrics metrics)
Adds new character metrics.
metrics
- the character metrics
addXKerning
public void addXKerning(String name1,
String name2,
double kx)
Adds a X-kerning entry.
name1
- the name of the first charactername2
- the name of the second characterkx
- kerning value in x-direction
createXKerningMapEncoded
public Map createXKerningMapEncoded()
Creates and returns a kerning map for writing mode 0 (ltr) with character codes.
- the kerning map or null if there is no kerning information.
getAscender
public Number getAscender()
Returns the Ascender value.
getCapHeight
public Number getCapHeight()
Returns the CapHeight value.
getChar
public AFMCharMetrics getChar(String name)
Returns the character metrics associated with the character name.
name
- the character name
- the character metrics or null if there's no such character
getCharCount
public int getCharCount()
Returns the number of character available for this font.
getCharMetrics
public List getCharMetrics()
Returns the list of AFMCharMetrics instances representing all the available characters.
- a List of AFMCharMetrics instances
getCharacterSet
public String getCharacterSet()
Returns the CharacterSet value.
getDescender
public Number getDescender()
Returns the Descender value.
getEncodingScheme
public String getEncodingScheme()
Returns the EncodingScheme value.
getFamilyName
public String getFamilyName()
Returns the FamilyName value.
- the family name of the font
getFirstChar
public int getFirstChar()
Returns the first character index in the encoding that has a glyph.
- the first character index with a glyph
getFontBBox
public RectangularShape getFontBBox()
Returns the FontBBox value.
getFontBBoxAsIntArray
public int[] getFontBBoxAsIntArray()
Returns the FontBBox value as integer array.
getFontName
public String getFontName()
Returns the FontName value.
getFullName
public String getFullName()
Returns the FullName value.
- the full name of the font
getLastChar
public int getLastChar()
Returns the last character index in the encoding that has a glyph.
- the last character index with a glyph
getStdHW
public Number getStdHW()
Returns the StdHW value.
getStdVW
public Number getStdVW()
Returns the StdVW value.
getWeight
public String getWeight()
Returns the Weight value.
getWritingDirectionMetrics
public AFMWritingDirectionMetrics getWritingDirectionMetrics(int index)
Gets writing direction metrics.
index
- the writing direction (0, 1 or 2)
- the writing direction metrics
getXHeight
public Number getXHeight()
Returns the XHeight value.
hasKerning
public boolean hasKerning()
Indicates whether the font has kerning information.
- true if there is kerning information
setAscender
public void setAscender(Number ascender)
Sets the Ascender value.
ascender
- the ascender to set
setCapHeight
public void setCapHeight(Number capHeight)
Sets the CapHeight value.
capHeight
- the capHeight to set
setCharacterSet
public void setCharacterSet(String characterSet)
Sets the CharacterSet value.
characterSet
- the characterSet to set
setDescender
public void setDescender(Number descender)
Sets the Descender value.
descender
- the descender to set
setEncodingScheme
public void setEncodingScheme(String encodingScheme)
Sets the EncodingScheme value
encodingScheme
- the encodingScheme to set
setFamilyName
public void setFamilyName(String familyName)
Sets the FamilyName value.
familyName
- the family name to set
setFontBBox
public void setFontBBox(RectangularShape fontBBox)
Sets the FontBBox value.
fontBBox
- the fontBBox to set
setFontName
public void setFontName(String fontName)
Sets the FontName value.
fontName
- the font name to set
setFullName
public void setFullName(String fullName)
Sets the FullName value.
fullName
- the full name to set
setStdHW
public void setStdHW(Number stdHW)
Sets the StdHW value.
setStdVW
public void setStdVW(Number stdVW)
Sets the StdVW value.
setWeight
public void setWeight(String weight)
Sets the Weight value.
weight
- the weight to set
setWritingDirectionMetrics
public void setWritingDirectionMetrics(int index,
AFMWritingDirectionMetrics metrics)
Sets writing direction metrics.
index
- the writing direction (0, 1 or 2)metrics
- the writing direction metrics
setXHeight
public void setXHeight(Number height)
Sets the XHeight value.
height
- the xHeight to set
toString
public String toString()