org.apache.fop.fonts
Class PFMFile


public class PFMFile

This class represents a PFM file (or parts of it) as a Java object.

Author:
jeremias.maerki@outline.ch

Constructor Summary
PFMFile()
           

Method Summary
 intgetCapHeight()
          Returns the CapHeight parameter for the font (height of uppercase H).
 shortgetCharSet()
          Returns the charset used for the font.
 StringgetCharSetName()
          Returns the charset of the font as a string.
 intgetCharWidth(short which)
          Returns the width of a character
 shortgetFirstChar()
          Returns the number of the character that defines the first entry in the widths list.
 intgetFlags()
          Returns the characteristics flags for the font as needed for a PDF font descriptor (See PDF specs).
 int[]getFontBBox()
          Returns the bounding box for the font.
 booleangetIsProportional()
          Tells whether the font has proportional character spacing.
 intgetItalicAngle()
          Returns the italic angle of the font.
 shortgetLastChar()
          Returns the number of the character that defines the last entry in the widths list.
 intgetLowerCaseAscent()
          Returns the LowerCaseAscent parameter for the font (height of lowercase d).
 intgetLowerCaseDescent()
          Returns the LowerCaseDescent parameter for the font (height of lowercase p).
 StringgetPostscriptName()
          Returns the Postscript name of the font.
 intgetStemV()
          Returns the width of the dominant vertical stems of the font.
 StringgetWindowsName()
          Returns the Windows name of the font.
 intgetXHeight()
          Returns the XHeight parameter for the font (height of lowercase x).
 voidload(InputStream inStream)
          Parses a PFM file

Constructor Detail

PFMFile

public PFMFile()
Method Detail

getCapHeight

public int getCapHeight()
Returns the CapHeight parameter for the font (height of uppercase H).
Returns: The CapHeight parameter.

getCharSet

public short getCharSet()
Returns the charset used for the font.
Returns: The charset (0=WinAnsi).

getCharSetName

public String getCharSetName()
Returns the charset of the font as a string.
Returns: The name of the charset.

getCharWidth

public int getCharWidth(short which)
Returns the width of a character
Parameters:
which - The number of the character for which the width is requested.
Returns: The width of a character.

getFirstChar

public short getFirstChar()
Returns the number of the character that defines the first entry in the widths list.
Returns: The number of the first character.

getFlags

public int getFlags()
Returns the characteristics flags for the font as needed for a PDF font descriptor (See PDF specs).
Returns: The characteristics flags.

getFontBBox

public int[] getFontBBox()
Returns the bounding box for the font. Note: this value is just an approximation, it does not really exist in the PFM file.
Returns: The calculated Font BBox.

getIsProportional

public boolean getIsProportional()
Tells whether the font has proportional character spacing.
Returns: ex. true for Times, false for Courier.

getItalicAngle

public int getItalicAngle()
Returns the italic angle of the font. Note: this value is just an approximation, it does not really exist in the PFM file.
Returns: The italic angle.

getLastChar

public short getLastChar()
Returns the number of the character that defines the last entry in the widths list.
Returns: The number of the last character.

getLowerCaseAscent

public int getLowerCaseAscent()
Returns the LowerCaseAscent parameter for the font (height of lowercase d).
Returns: The LowerCaseAscent parameter.

getLowerCaseDescent

public int getLowerCaseDescent()
Returns the LowerCaseDescent parameter for the font (height of lowercase p).
Returns: The LowerCaseDescent parameter.

getPostscriptName

public String getPostscriptName()
Returns the Postscript name of the font.
Returns: The Postscript name.

getStemV

public int getStemV()
Returns the width of the dominant vertical stems of the font. Note: this value is just an approximation, it does not really exist in the PFM file.
Returns: The vertical stem width.

getWindowsName

public String getWindowsName()
Returns the Windows name of the font.
Returns: The Windows name.

getXHeight

public int getXHeight()
Returns the XHeight parameter for the font (height of lowercase x).
Returns: The CapHeight parameter.

load

public void load(InputStream inStream)
throws java.io.IOException
Parses a PFM file
Parameters:
inStream - The stream from which to read the PFM file.

Association Links

to Class java.lang.String

to Class java.lang.String