org.apache.fop.fonts.type1

## Class AFMCharMetrics

- java.lang.Object
- - org.apache.fop.fonts.type1.AFMCharMetrics

    public class AFMCharMetrics
    extends Object

Holds the metrics of a single character from an AFM file.

### Constructor Summary

Constructors
Constructor and Description
`AFMCharMetrics()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Rectangle` `getBBox()` Returns the character's bounding box.
`NamedCharacter` `getCharacter()` Returns the named character represented by this instance.
`int` `getCharCode()` Returns the character code.
`String` `getCharName()` Returns the PostScript character name.
`String` `getUnicodeSequence()` Returns the Unicode sequence for this character.
`double` `getWidthX()` Returns the progression dimension in x-direction.
`double` `getWidthY()` Returns the progression dimension in y-direction.
`boolean` `hasCharCode()` Indicates whether the character has a character code, i.e.
`void` `setBBox(Rectangle box)` Sets the character's bounding box.
`void` `setCharacter(NamedCharacter ch)` Sets the named character represented by this instance.
`void` `setCharacter(String charName, String unicodeSequence)` 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-direction
`void` `setWidthY(double widthY)` Sets the progression dimension in y-direction
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### AFMCharMetrics

    public AFMCharMetrics()

### Method Detail

#### 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

    public NamedCharacter getCharacter()

Returns the named character represented by this instance.

Returns:
  the named character (or null if no named character is associated)

#### setCharacter

    public void setCharacter(NamedCharacter ch)

Sets the named character represented by this instance.

Parameters:
  `ch` - the named character

#### setCharacter

    public void setCharacter(String charName,
                             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 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 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 Rectangle getBBox()

Returns the character's bounding box.

Returns:
  the bounding box (or null if it isn't available)

#### setBBox

    public void setBBox(Rectangle box)

Sets the character's bounding box.

Parameters:
  `box` - the bounding box

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`