public class AFMFile
extends java.lang.Object
| Constructor and Description |
|---|
AFMFile()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharMetrics(AFMCharMetrics metrics)
Adds new character metrics.
|
void |
addXKerning(java.lang.String name1,
java.lang.String name2,
double kx)
Adds a X-kerning entry.
|
java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Integer>> |
createXKerningMapEncoded()
Creates and returns a kerning map for writing mode 0 (ltr) with character codes.
|
java.lang.Number |
getAscender()
Returns the Ascender value.
|
java.lang.Number |
getCapHeight()
Returns the CapHeight value.
|
AFMCharMetrics |
getChar(java.lang.String name)
Returns the character metrics associated with the character name.
|
java.lang.String |
getCharacterSet()
Returns the CharacterSet value.
|
int |
getCharCount()
Returns the number of character available for this font.
|
java.util.List<AFMCharMetrics> |
getCharMetrics()
Returns the list of AFMCharMetrics instances representing all the available characters.
|
java.lang.Number |
getDescender()
Returns the Descender value.
|
java.lang.String |
getEncodingScheme()
Returns the EncodingScheme value.
|
java.lang.String |
getFamilyName()
Returns the FamilyName value.
|
int |
getFirstChar()
Returns the first character index in the encoding that has a glyph.
|
java.awt.geom.RectangularShape |
getFontBBox()
Returns the FontBBox value.
|
int[] |
getFontBBoxAsIntArray()
Returns the FontBBox value as integer array.
|
java.lang.String |
getFontName()
Returns the FontName value.
|
java.lang.String |
getFullName()
Returns the FullName value.
|
int |
getLastChar()
Returns the last character index in the encoding that has a glyph.
|
java.lang.Number |
getStdHW()
Returns the StdHW value.
|
java.lang.Number |
getStdVW()
Returns the StdVW value.
|
java.lang.String |
getWeight()
Returns the Weight value.
|
AFMWritingDirectionMetrics |
getWritingDirectionMetrics(int index)
Gets writing direction metrics.
|
java.lang.Number |
getXHeight()
Returns the XHeight value.
|
boolean |
hasKerning()
Indicates whether the font has kerning information.
|
void |
overridePrimaryEncoding(SingleByteEncoding encoding)
The character codes in an AFM cannot always be trusted to be the same values as in the
font's primary encoding.
|
void |
setAscender(java.lang.Number ascender)
Sets the Ascender value.
|
void |
setCapHeight(java.lang.Number capHeight)
Sets the CapHeight value.
|
void |
setCharacterSet(java.lang.String characterSet)
Sets the CharacterSet value.
|
void |
setDescender(java.lang.Number descender)
Sets the Descender value.
|
void |
setEncodingScheme(java.lang.String encodingScheme)
Sets the EncodingScheme value
|
void |
setFamilyName(java.lang.String familyName)
Sets the FamilyName value.
|
void |
setFontBBox(java.awt.geom.RectangularShape fontBBox)
Sets the FontBBox value.
|
void |
setFontName(java.lang.String fontName)
Sets the FontName value.
|
void |
setFullName(java.lang.String fullName)
Sets the FullName value.
|
void |
setStdHW(java.lang.Number stdHW)
Sets the StdHW value.
|
void |
setStdVW(java.lang.Number stdVW)
Sets the StdVW value.
|
void |
setWeight(java.lang.String weight)
Sets the Weight value.
|
void |
setWritingDirectionMetrics(int index,
AFMWritingDirectionMetrics metrics)
Sets writing direction metrics.
|
void |
setXHeight(java.lang.Number height)
Sets the XHeight value.
|
java.lang.String |
toString() |
public java.lang.String getFontName()
public void setFontName(java.lang.String fontName)
fontName - the font name to setpublic java.lang.String getFullName()
public void setFullName(java.lang.String fullName)
fullName - the full name to setpublic java.lang.String getFamilyName()
public void setFamilyName(java.lang.String familyName)
familyName - the family name to setpublic java.lang.String getWeight()
public void setWeight(java.lang.String weight)
weight - the weight to setpublic java.awt.geom.RectangularShape getFontBBox()
public int[] getFontBBoxAsIntArray()
public void setFontBBox(java.awt.geom.RectangularShape fontBBox)
fontBBox - the fontBBox to setpublic java.lang.String getEncodingScheme()
public void setEncodingScheme(java.lang.String encodingScheme)
encodingScheme - the encodingScheme to setpublic java.lang.String getCharacterSet()
public void setCharacterSet(java.lang.String characterSet)
characterSet - the characterSet to setpublic java.lang.Number getCapHeight()
public void setCapHeight(java.lang.Number capHeight)
capHeight - the capHeight to setpublic java.lang.Number getXHeight()
public void setXHeight(java.lang.Number height)
height - the xHeight to setpublic java.lang.Number getAscender()
public void setAscender(java.lang.Number ascender)
ascender - the ascender to setpublic java.lang.Number getDescender()
public void setDescender(java.lang.Number descender)
descender - the descender to setpublic java.lang.Number getStdHW()
public void setStdHW(java.lang.Number stdHW)
stdHW - the StdHW to setpublic java.lang.Number getStdVW()
public void setStdVW(java.lang.Number stdVW)
stdVW - the StdVW to setpublic AFMWritingDirectionMetrics getWritingDirectionMetrics(int index)
index - the writing direction (0, 1 or 2)public void setWritingDirectionMetrics(int index,
AFMWritingDirectionMetrics metrics)
index - the writing direction (0, 1 or 2)metrics - the writing direction metricspublic void addCharMetrics(AFMCharMetrics metrics)
metrics - the character metricspublic int getCharCount()
public int getFirstChar()
public int getLastChar()
public AFMCharMetrics getChar(java.lang.String name)
name - the character namepublic java.util.List<AFMCharMetrics> getCharMetrics()
public void addXKerning(java.lang.String name1,
java.lang.String name2,
double kx)
name1 - the name of the first charactername2 - the name of the second characterkx - kerning value in x-directionpublic boolean hasKerning()
public java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Integer>> createXKerningMapEncoded()
public void overridePrimaryEncoding(SingleByteEncoding encoding)
encoding - the encoding to replace the one given in the AFMpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright 1999-2022 The Apache Software Foundation. All Rights Reserved.