org.pdfbox.pdmodel.font
Class PDFontDescriptorAFM

java.lang.Object
  extended byorg.pdfbox.pdmodel.font.PDFontDescriptor
      extended byorg.pdfbox.pdmodel.font.PDFontDescriptorAFM

public class PDFontDescriptorAFM
extends PDFontDescriptor

This class represents the font descriptor when the font information is coming from an AFM file.

Version:
$Revision: 1.3 $
Author:
Ben Litchfield

Constructor Summary
PDFontDescriptorAFM(org.fontbox.afm.FontMetric afmFile)
          Constructor.
 
Method Summary
 float getAscent()
          This will get the ascent for the font.
 float getAverageWidth()
          This will get the average width for the font.
 float getCapHeight()
          This will get the CapHeight for the font.
 String getCharSet()
          This will get the character set for the font.
 float getDescent()
          This will get the descent for the font.
 int getFlags()
          This will get the font flags.
 PDRectangle getFontBoundingBox()
          This will get the fonts bouding box.
 String getFontFamily()
          A string representing the preferred font family.
 String getFontName()
          Get the font name.
 String getFontStretch()
          A string representing the preferred font stretch.
 float getFontWeight()
          The weight of the font.
 float getItalicAngle()
          This will get the italic angle for the font.
 float getLeading()
          This will get the leading for the font.
 float getMaxWidth()
          This will get the max width for the font.
 float getMissingWidth()
          This will get the missing width for the font.
 float getStemH()
          This will get the stemH for the font.
 float getStemV()
          This will get the stemV for the font.
 float getXHeight()
          This will get the x height for the font.
 void setAscent(float ascent)
          This will set the ascent for the font.
 void setAverageWidth(float averageWidth)
          This will set the average width for the font.
 void setCapHeight(float capHeight)
          This will set the cap height for the font.
 void setCharacterSet(String charSet)
          This will set the character set for the font.
 void setDescent(float descent)
          This will set the descent for the font.
 void setFlags(int flags)
          This will set the font flags.
 void setFontBoundingBox(PDRectangle rect)
          Set the fonts bounding box.
 void setFontFamily(String fontFamily)
          This will set the font family.
 void setFontName(String fontName)
          This will set the font name.
 void setFontStretch(String fontStretch)
          This will set the font stretch.
 void setFontWeight(float fontWeight)
          Set the weight of the font.
 void setItalicAngle(float angle)
          This will set the italic angle for the font.
 void setLeading(float leading)
          This will set the leading for the font.
 void setMaxWidth(float maxWidth)
          This will set the max width for the font.
 void setMissingWidth(float missingWidth)
          This will set the missing width for the font.
 void setStemH(float stemH)
          This will set the stem H for the font.
 void setStemV(float stemV)
          This will set the stem V for the font.
 void setXHeight(float xHeight)
          This will set the x height for the font.
 
Methods inherited from class org.pdfbox.pdmodel.font.PDFontDescriptor
isAllCap, isFixedPitch, isForceBold, isItalic, isNonSymbolic, isScript, isSerif, isSmallCap, isSymbolic, setAllCap, setFixedPitch, setForceBold, setItalic, setNonSymbolic, setScript, setSerif, setSmallCap, setSymbolic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFontDescriptorAFM

public PDFontDescriptorAFM(org.fontbox.afm.FontMetric afmFile)
Constructor.

Parameters:
afmFile - The AFM file.
Method Detail

getFontName

public String getFontName()
Get the font name.

Specified by:
getFontName in class PDFontDescriptor
Returns:
The name of the font.

setFontName

public void setFontName(String fontName)
This will set the font name.

Specified by:
setFontName in class PDFontDescriptor
Parameters:
fontName - The new name for the font.

getFontFamily

public String getFontFamily()
A string representing the preferred font family.

Specified by:
getFontFamily in class PDFontDescriptor
Returns:
The font family.

setFontFamily

public void setFontFamily(String fontFamily)
This will set the font family.

Specified by:
setFontFamily in class PDFontDescriptor
Parameters:
fontFamily - The font family.

getFontWeight

public float getFontWeight()
The weight of the font. According to the PDF spec "possible values are 100, 200, 300, 400, 500, 600, 700, 800 or 900" Where a higher number is more weight and appears to be more bold.

Specified by:
getFontWeight in class PDFontDescriptor
Returns:
The font weight.

setFontWeight

public void setFontWeight(float fontWeight)
Set the weight of the font.

Specified by:
setFontWeight in class PDFontDescriptor
Parameters:
fontWeight - The new weight of the font.

getFontStretch

public String getFontStretch()
A string representing the preferred font stretch.

Specified by:
getFontStretch in class PDFontDescriptor
Returns:
The font stretch.

setFontStretch

public void setFontStretch(String fontStretch)
This will set the font stretch.

Specified by:
setFontStretch in class PDFontDescriptor
Parameters:
fontStretch - The font stretch

getFlags

public int getFlags()
This will get the font flags.

Specified by:
getFlags in class PDFontDescriptor
Returns:
The font flags.

setFlags

public void setFlags(int flags)
This will set the font flags.

Specified by:
setFlags in class PDFontDescriptor
Parameters:
flags - The new font flags.

getFontBoundingBox

public PDRectangle getFontBoundingBox()
This will get the fonts bouding box.

Specified by:
getFontBoundingBox in class PDFontDescriptor
Returns:
The fonts bouding box.

setFontBoundingBox

public void setFontBoundingBox(PDRectangle rect)
Set the fonts bounding box.

Specified by:
setFontBoundingBox in class PDFontDescriptor
Parameters:
rect - The new bouding box.

getItalicAngle

public float getItalicAngle()
This will get the italic angle for the font.

Specified by:
getItalicAngle in class PDFontDescriptor
Returns:
The italic angle.

setItalicAngle

public void setItalicAngle(float angle)
This will set the italic angle for the font.

Specified by:
setItalicAngle in class PDFontDescriptor
Parameters:
angle - The new italic angle for the font.

getAscent

public float getAscent()
This will get the ascent for the font.

Specified by:
getAscent in class PDFontDescriptor
Returns:
The ascent.

setAscent

public void setAscent(float ascent)
This will set the ascent for the font.

Specified by:
setAscent in class PDFontDescriptor
Parameters:
ascent - The new ascent for the font.

getDescent

public float getDescent()
This will get the descent for the font.

Specified by:
getDescent in class PDFontDescriptor
Returns:
The descent.

setDescent

public void setDescent(float descent)
This will set the descent for the font.

Specified by:
setDescent in class PDFontDescriptor
Parameters:
descent - The new descent for the font.

getLeading

public float getLeading()
This will get the leading for the font.

Specified by:
getLeading in class PDFontDescriptor
Returns:
The leading.

setLeading

public void setLeading(float leading)
This will set the leading for the font.

Specified by:
setLeading in class PDFontDescriptor
Parameters:
leading - The new leading for the font.

getCapHeight

public float getCapHeight()
This will get the CapHeight for the font.

Specified by:
getCapHeight in class PDFontDescriptor
Returns:
The cap height.

setCapHeight

public void setCapHeight(float capHeight)
This will set the cap height for the font.

Specified by:
setCapHeight in class PDFontDescriptor
Parameters:
capHeight - The new cap height for the font.

getXHeight

public float getXHeight()
This will get the x height for the font.

Specified by:
getXHeight in class PDFontDescriptor
Returns:
The x height.

setXHeight

public void setXHeight(float xHeight)
This will set the x height for the font.

Specified by:
setXHeight in class PDFontDescriptor
Parameters:
xHeight - The new x height for the font.

getStemV

public float getStemV()
This will get the stemV for the font.

Specified by:
getStemV in class PDFontDescriptor
Returns:
The stem v value.

setStemV

public void setStemV(float stemV)
This will set the stem V for the font.

Specified by:
setStemV in class PDFontDescriptor
Parameters:
stemV - The new stem v for the font.

getStemH

public float getStemH()
This will get the stemH for the font.

Specified by:
getStemH in class PDFontDescriptor
Returns:
The stem h value.

setStemH

public void setStemH(float stemH)
This will set the stem H for the font.

Specified by:
setStemH in class PDFontDescriptor
Parameters:
stemH - The new stem h for the font.

getAverageWidth

public float getAverageWidth()
                      throws IOException
This will get the average width for the font.

Specified by:
getAverageWidth in class PDFontDescriptor
Returns:
The average width value.
Throws:
IOException - If there is an error calculating the average width.

setAverageWidth

public void setAverageWidth(float averageWidth)
This will set the average width for the font.

Specified by:
setAverageWidth in class PDFontDescriptor
Parameters:
averageWidth - The new average width for the font.

getMaxWidth

public float getMaxWidth()
This will get the max width for the font.

Specified by:
getMaxWidth in class PDFontDescriptor
Returns:
The max width value.

setMaxWidth

public void setMaxWidth(float maxWidth)
This will set the max width for the font.

Specified by:
setMaxWidth in class PDFontDescriptor
Parameters:
maxWidth - The new max width for the font.

getMissingWidth

public float getMissingWidth()
This will get the missing width for the font.

Returns:
The missing width value.

setMissingWidth

public void setMissingWidth(float missingWidth)
This will set the missing width for the font.

Parameters:
missingWidth - The new missing width for the font.

getCharSet

public String getCharSet()
This will get the character set for the font.

Specified by:
getCharSet in class PDFontDescriptor
Returns:
The character set value.

setCharacterSet

public void setCharacterSet(String charSet)
This will set the character set for the font.

Specified by:
setCharacterSet in class PDFontDescriptor
Parameters:
charSet - The new character set for the font.