Package org.apache.fop.fonts.type1
Class AFMCharMetrics
java.lang.Object
org.apache.fop.fonts.type1.AFMCharMetrics
Holds the metrics of a single character from an AFM file.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBBox()
Returns the character's bounding box.Returns the named character represented by this instance.int
Returns the character code.Returns the PostScript character name.Returns the Unicode sequence for this character.double
Returns the progression dimension in x-direction.double
Returns the progression dimension in y-direction.boolean
Indicates whether the character has a character code, i.e.void
Sets the character's bounding box.void
setCharacter
(String charName, String unicodeSequence) Sets the named character represented by this instance.void
Sets the named character represented by this instance.void
setCharCode
(int charCode) Sets the character code.void
setWidthX
(double widthX) Sets the progression dimension in x-directionvoid
setWidthY
(double widthY) Sets the progression dimension in y-directiontoString()
-
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
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
Returns the Unicode sequence for this character.- Returns:
- the Unicode characters (or null if no such Unicode sequence exists for this character)
-
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
Returns the character's bounding box.- Returns:
- the bounding box (or null if it isn't available)
-
setBBox
Sets the character's bounding box.- Parameters:
box
- the bounding box
-
toString
-