Package org.docx4j.fonts.fop.fonts.type1
Class AFMCharMetrics
java.lang.Object
org.docx4j.fonts.fop.fonts.type1.AFMCharMetrics
public class AFMCharMetrics
extends java.lang.Object
Holds the metrics of a single character from an AFM file.
-
Constructor Summary
Constructors Constructor Description AFMCharMetrics() -
Method Summary
Modifier and Type Method Description java.awt.geom.RectangularShapegetBBox()Returns the character's bounding box.NamedCharactergetCharacter()Returns the named character represented by this instance.intgetCharCode()Returns the character code.java.lang.StringgetCharName()Returns the PostScript character name.java.lang.StringgetUnicodeSequence()Returns the Unicode sequence for this character.doublegetWidthX()Returns the progression dimension in x-direction.doublegetWidthY()Returns the progression dimension in y-direction.booleanhasCharCode()Indicates whether the character has a character code, i.e.voidsetBBox(java.awt.geom.RectangularShape box)Sets the character's bounding box.voidsetCharacter(java.lang.String charName, java.lang.String unicodeSequence)Sets the named character represented by this instance.voidsetCharacter(NamedCharacter ch)Sets the named character represented by this instance.voidsetCharCode(int charCode)Sets the character code.voidsetWidthX(double widthX)Sets the progression dimension in x-directionvoidsetWidthY(double widthY)Sets the progression dimension in y-directionjava.lang.StringtoString()
-
Constructor Details
-
AFMCharMetrics
public AFMCharMetrics()
-
-
Method Details
-
getCharCode
public int getCharCode()Returns the character code.- Returns:
- the charCode (-1 if not part of the encoding)
-
hasCharCode
public boolean hasCharCode()Indicates whether the character has a character code, i.e. is part of the default encoding.- Returns:
- true if there is a character code.
-
setCharCode
public void setCharCode(int charCode)Sets the character code.- Parameters:
charCode- the charCode to set
-
getCharacter
Returns the named character represented by this instance.- Returns:
- the named character (or null if no named character is associated)
-
setCharacter
Sets the named character represented by this instance.- Parameters:
ch- the named character
-
setCharacter
public void setCharacter(java.lang.String charName, java.lang.String unicodeSequence)Sets the named character represented by this instance.- Parameters:
charName- the character name (as defined in the Adobe glyph list)unicodeSequence- the Unicode sequence
-
getUnicodeSequence
public java.lang.String getUnicodeSequence()Returns the Unicode sequence for this character.- Returns:
- the Unicode characters (or null if no such Unicode sequence exists for this character)
-
getCharName
public java.lang.String getCharName()Returns the PostScript character name.- Returns:
- the charName (or null if no character name is associated)
-
getWidthX
public double getWidthX()Returns the progression dimension in x-direction.- Returns:
- the widthX
-
setWidthX
public void setWidthX(double widthX)Sets the progression dimension in x-direction- Parameters:
widthX- the widthX to set
-
getWidthY
public double getWidthY()Returns the progression dimension in y-direction.- Returns:
- the widthY
-
setWidthY
public void setWidthY(double widthY)Sets the progression dimension in y-direction- Parameters:
widthY- the widthY to set
-
getBBox
public java.awt.geom.RectangularShape getBBox()Returns the character's bounding box.- Returns:
- the bounding box (or null if it isn't available)
-
setBBox
public void setBBox(java.awt.geom.RectangularShape box)Sets the character's bounding box.- Parameters:
box- the bounding box
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-