org.pdfbox.pdmodel.font

Class PDFontDescriptorDictionary

Implemented Interfaces:
COSObjectable

public class PDFontDescriptorDictionary
extends PDFontDescriptor
implements COSObjectable

This class represents an implementation to the font descriptor that gets its information from a COS Dictionary.
Version:
$Revision: 1.4 $
Author:
Ben Litchfield

Constructor Summary

PDFontDescriptorDictionary()
Constructor.
PDFontDescriptorDictionary(COSDictionary desc)
Constructor.

Method Summary

float
getAscent()
This will get the ascent for the font.
float
getAverageWidth()
This will get the average width for the font.
COSDictionary
getCOSDictionary()
This will get the dictionary for this object.
COSBase
getCOSObject()
Convert this standard java object to a COS object.
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.
PDStream
getFontFile()
A stream containing a Type 1 font program.
PDStream
getFontFile2()
A stream containing a true type font program.
PDStream
getFontFile3()
A stream containing a font program that is not true type or type 1.
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
setFontFile(PDStream type1Stream)
Set the type 1 font program.
void
setFontFile2(PDStream ttfStream)
Set the true type font program.
void
setFontFile3(PDStream stream)
Set a stream containing a font program that is not true type or type 1.
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

getAscent, getAverageWidth, getCapHeight, getCharSet, getDescent, getFlags, getFontBoundingBox, getFontFamily, getFontName, getFontStretch, getFontWeight, getItalicAngle, getLeading, getMaxWidth, getStemH, getStemV, getXHeight, isAllCap, isFixedPitch, isForceBold, isItalic, isNonSymbolic, isScript, isSerif, isSmallCap, isSymbolic, setAllCap, setAscent, setAverageWidth, setCapHeight, setCharacterSet, setDescent, setFixedPitch, setFlags, setFontBoundingBox, setFontFamily, setFontName, setFontStretch, setFontWeight, setForceBold, setItalic, setItalicAngle, setLeading, setMaxWidth, setNonSymbolic, setScript, setSerif, setSmallCap, setStemH, setStemV, setSymbolic, setXHeight

Constructor Details

PDFontDescriptorDictionary

public PDFontDescriptorDictionary()
Constructor.

PDFontDescriptorDictionary

public PDFontDescriptorDictionary(COSDictionary desc)
Constructor.
Parameters:
desc - The wrapped COS Dictionary.

Method Details

getAscent

public float getAscent()
This will get the ascent for the font.
Overrides:
getAscent in interface PDFontDescriptor
Returns:
The ascent.

getAverageWidth

public float getAverageWidth()
This will get the average width for the font.
Overrides:
getAverageWidth in interface PDFontDescriptor
Returns:
The average width value.

getCOSDictionary

public COSDictionary getCOSDictionary()
This will get the dictionary for this object.
Returns:
The COS dictionary.

getCOSObject

public COSBase getCOSObject()
Convert this standard java object to a COS object.
Specified by:
getCOSObject in interface COSObjectable
Returns:
The cos object that matches this Java object.

getCapHeight

public float getCapHeight()
This will get the CapHeight for the font.
Overrides:
getCapHeight in interface PDFontDescriptor
Returns:
The cap height.

getCharSet

public String getCharSet()
This will get the character set for the font.
Overrides:
getCharSet in interface PDFontDescriptor
Returns:
The character set value.

getDescent

public float getDescent()
This will get the descent for the font.
Overrides:
getDescent in interface PDFontDescriptor
Returns:
The descent.

getFlags

public int getFlags()
This will get the font flags.
Overrides:
getFlags in interface PDFontDescriptor
Returns:
The font flags.

getFontBoundingBox

public PDRectangle getFontBoundingBox()
This will get the fonts bouding box.
Overrides:
getFontBoundingBox in interface PDFontDescriptor
Returns:
The fonts bouding box.

getFontFamily

public String getFontFamily()
A string representing the preferred font family.
Overrides:
getFontFamily in interface PDFontDescriptor
Returns:
The font family.

getFontFile

public PDStream getFontFile()
A stream containing a Type 1 font program.
Returns:
A stream containing a Type 1 font program.

getFontFile2

public PDStream getFontFile2()
A stream containing a true type font program.
Returns:
A stream containing a true type font program.

getFontFile3

public PDStream getFontFile3()
A stream containing a font program that is not true type or type 1.
Returns:
A stream containing a font program.

getFontName

public String getFontName()
Get the font name.
Overrides:
getFontName in interface PDFontDescriptor
Returns:
The name of the font.

getFontStretch

public String getFontStretch()
A string representing the preferred font stretch. According to the PDF Spec: The font stretch value; it must be one of the following (ordered from narrowest to widest): UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, Normal, SemiExpanded, Expanded, ExtraExpanded or UltraExpanded.
Overrides:
getFontStretch in interface PDFontDescriptor
Returns:
The stretch of the font.

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.
Overrides:
getFontWeight in interface PDFontDescriptor
Returns:
The font weight.

getItalicAngle

public float getItalicAngle()
This will get the italic angle for the font.
Overrides:
getItalicAngle in interface PDFontDescriptor
Returns:
The italic angle.

getLeading

public float getLeading()
This will get the leading for the font.
Overrides:
getLeading in interface PDFontDescriptor
Returns:
The leading.

getMaxWidth

public float getMaxWidth()
This will get the max width for the font.
Overrides:
getMaxWidth in interface PDFontDescriptor
Returns:
The max width value.

getMissingWidth

public float getMissingWidth()
This will get the missing width for the font.
Returns:
The missing width value.

getStemH

public float getStemH()
This will get the stemH for the font.
Overrides:
getStemH in interface PDFontDescriptor
Returns:
The stem h value.

getStemV

public float getStemV()
This will get the stemV for the font.
Overrides:
getStemV in interface PDFontDescriptor
Returns:
The stem v value.

getXHeight

public float getXHeight()
This will get the x height for the font.
Overrides:
getXHeight in interface PDFontDescriptor
Returns:
The x height.

setAscent

public void setAscent(float ascent)
This will set the ascent for the font.
Overrides:
setAscent in interface PDFontDescriptor
Parameters:
ascent - The new ascent for the font.

setAverageWidth

public void setAverageWidth(float averageWidth)
This will set the average width for the font.
Overrides:
setAverageWidth in interface PDFontDescriptor
Parameters:
averageWidth - The new average width for the font.

setCapHeight

public void setCapHeight(float capHeight)
This will set the cap height for the font.
Overrides:
setCapHeight in interface PDFontDescriptor
Parameters:
capHeight - The new cap height for the font.

setCharacterSet

public void setCharacterSet(String charSet)
This will set the character set for the font.
Overrides:
setCharacterSet in interface PDFontDescriptor
Parameters:
charSet - The new character set for the font.

setDescent

public void setDescent(float descent)
This will set the descent for the font.
Overrides:
setDescent in interface PDFontDescriptor
Parameters:
descent - The new descent for the font.

setFlags

public void setFlags(int flags)
This will set the font flags.
Overrides:
setFlags in interface PDFontDescriptor
Parameters:
flags - The new font flags.

setFontBoundingBox

public void setFontBoundingBox(PDRectangle rect)
Set the fonts bounding box.
Overrides:
setFontBoundingBox in interface PDFontDescriptor
Parameters:
rect - The new bouding box.

setFontFamily

public void setFontFamily(String fontFamily)
This will set the font family.
Overrides:
setFontFamily in interface PDFontDescriptor
Parameters:
fontFamily - The font family.

setFontFile

public void setFontFile(PDStream type1Stream)
Set the type 1 font program.
Parameters:
type1Stream - The type 1 stream.

setFontFile2

public void setFontFile2(PDStream ttfStream)
Set the true type font program.
Parameters:
ttfStream - The true type stream.

setFontFile3

public void setFontFile3(PDStream stream)
Set a stream containing a font program that is not true type or type 1.
Parameters:
stream - The font program stream.

setFontName

public void setFontName(String fontName)
This will set the font name.
Overrides:
setFontName in interface PDFontDescriptor
Parameters:
fontName - The new name for the font.

setFontStretch

public void setFontStretch(String fontStretch)
This will set the font stretch.
Overrides:
setFontStretch in interface PDFontDescriptor
Parameters:
fontStretch - The new stretch for the font.

setFontWeight

public void setFontWeight(float fontWeight)
Set the weight of the font.
Overrides:
setFontWeight in interface PDFontDescriptor
Parameters:
fontWeight - The new weight of the font.

setItalicAngle

public void setItalicAngle(float angle)
This will set the italic angle for the font.
Overrides:
setItalicAngle in interface PDFontDescriptor
Parameters:
angle - The new italic angle for the font.

setLeading

public void setLeading(float leading)
This will set the leading for the font.
Overrides:
setLeading in interface PDFontDescriptor
Parameters:
leading - The new leading for the font.

setMaxWidth

public void setMaxWidth(float maxWidth)
This will set the max width for the font.
Overrides:
setMaxWidth in interface PDFontDescriptor
Parameters:
maxWidth - The new max width for the font.

setMissingWidth

public void setMissingWidth(float missingWidth)
This will set the missing width for the font.
Parameters:
missingWidth - The new missing width for the font.

setStemH

public void setStemH(float stemH)
This will set the stem H for the font.
Overrides:
setStemH in interface PDFontDescriptor
Parameters:
stemH - The new stem h for the font.

setStemV

public void setStemV(float stemV)
This will set the stem V for the font.
Overrides:
setStemV in interface PDFontDescriptor
Parameters:
stemV - The new stem v for the font.

setXHeight

public void setXHeight(float xHeight)
This will set the x height for the font.
Overrides:
setXHeight in interface PDFontDescriptor
Parameters:
xHeight - The new x height for the font.