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

      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