Package org.apache.pdfbox.pdmodel.font
Class PDFontDescriptorDictionary
java.lang.Object
org.apache.pdfbox.pdmodel.font.PDFontDescriptor
org.apache.pdfbox.pdmodel.font.PDFontDescriptorDictionary
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionConstructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfloatThis will get the ascent for the font.floatThis will get the average width for the font.floatThis will get the CapHeight for the font.This will get the character set for the font.This will get the dictionary for this object.Convert this standard java object to a COS object.floatThis will get the descent for the font.intgetFlags()This will get the font flags.This will get the fonts bounding box.A string representing the preferred font family.A stream containing a Type 1 font program.A stream containing a true type font program.A stream containing a font program that is not true type or type 1.Get the font name.A string representing the preferred font stretch.floatThe weight of the font.floatThis will get the italic angle for the font.floatThis will get the leading for the font.floatThis will get the max width for the font.floatThis will get the missing width for the font.floatgetStemH()This will get the stemH for the font.floatgetStemV()This will get the stemV for the font.floatThis will get the x height for the font.voidsetAscent(float ascent) This will set the ascent for the font.voidsetAverageWidth(float averageWidth) This will set the average width for the font.voidsetCapHeight(float capHeight) This will set the cap height for the font.voidsetCharacterSet(String charSet) This will set the character set for the font.voidsetDescent(float descent) This will set the descent for the font.voidsetFlags(int flags) This will set the font flags.voidSet the fonts bounding box.voidsetFontFamily(String fontFamily) This will set the font family.voidsetFontFile(PDStream type1Stream) Set the type 1 font program.voidsetFontFile2(PDStream ttfStream) Set the true type font program.voidsetFontFile3(PDStream stream) Set a stream containing a font program that is not true type or type 1.voidsetFontName(String fontName) This will set the font name.voidsetFontStretch(String fontStretch) This will set the font stretch.voidsetFontWeight(float fontWeight) Set the weight of the font.voidsetItalicAngle(float angle) This will set the italic angle for the font.voidsetLeading(float leading) This will set the leading for the font.voidsetMaxWidth(float maxWidth) This will set the max width for the font.voidsetMissingWidth(float missingWidth) This will set the missing width for the font.voidsetStemH(float stemH) This will set the stem H for the font.voidsetStemV(float stemV) This will set the stem V for the font.voidsetXHeight(float xHeight) This will set the x height for the font.Methods inherited from class org.apache.pdfbox.pdmodel.font.PDFontDescriptor
isAllCap, isFixedPitch, isForceBold, isItalic, isNonSymbolic, isScript, isSerif, isSmallCap, isSymbolic, setAllCap, setFixedPitch, setForceBold, setItalic, setNonSymbolic, setScript, setSerif, setSmallCap, setSymbolic
-
Constructor Details
-
PDFontDescriptorDictionary
public PDFontDescriptorDictionary()Constructor. -
PDFontDescriptorDictionary
Constructor.- Parameters:
desc- The wrapped COS Dictionary.
-
-
Method Details
-
getCOSDictionary
This will get the dictionary for this object.- Returns:
- The COS dictionary.
-
getCOSObject
Convert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The cos object that matches this Java object.
-
getFontName
Get the font name.- Specified by:
getFontNamein classPDFontDescriptor- Returns:
- The name of the font.
-
setFontName
This will set the font name.- Specified by:
setFontNamein classPDFontDescriptor- Parameters:
fontName- The new name for the font.
-
getFontFamily
A string representing the preferred font family.- Specified by:
getFontFamilyin classPDFontDescriptor- Returns:
- The font family.
-
setFontFamily
This will set the font family.- Specified by:
setFontFamilyin classPDFontDescriptor- 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:
getFontWeightin classPDFontDescriptor- Returns:
- The font weight.
-
setFontWeight
public void setFontWeight(float fontWeight) Set the weight of the font.- Specified by:
setFontWeightin classPDFontDescriptor- Parameters:
fontWeight- The new weight of the font.
-
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.- Specified by:
getFontStretchin classPDFontDescriptor- Returns:
- The stretch of the font.
-
setFontStretch
This will set the font stretch.- Specified by:
setFontStretchin classPDFontDescriptor- Parameters:
fontStretch- The new stretch for the font.
-
getFlags
public int getFlags()This will get the font flags.- Specified by:
getFlagsin classPDFontDescriptor- Returns:
- The font flags.
-
setFlags
public void setFlags(int flags) This will set the font flags.- Specified by:
setFlagsin classPDFontDescriptor- Parameters:
flags- The new font flags.
-
getFontBoundingBox
This will get the fonts bounding box.- Specified by:
getFontBoundingBoxin classPDFontDescriptor- Returns:
- The fonts bounding box.
-
setFontBoundingBox
Set the fonts bounding box.- Specified by:
setFontBoundingBoxin classPDFontDescriptor- Parameters:
rect- The new bouding box.
-
getItalicAngle
public float getItalicAngle()This will get the italic angle for the font.- Specified by:
getItalicAnglein classPDFontDescriptor- Returns:
- The italic angle.
-
setItalicAngle
public void setItalicAngle(float angle) This will set the italic angle for the font.- Specified by:
setItalicAnglein classPDFontDescriptor- Parameters:
angle- The new italic angle for the font.
-
getAscent
public float getAscent()This will get the ascent for the font.- Specified by:
getAscentin classPDFontDescriptor- Returns:
- The ascent.
-
setAscent
public void setAscent(float ascent) This will set the ascent for the font.- Specified by:
setAscentin classPDFontDescriptor- Parameters:
ascent- The new ascent for the font.
-
getDescent
public float getDescent()This will get the descent for the font.- Specified by:
getDescentin classPDFontDescriptor- Returns:
- The descent.
-
setDescent
public void setDescent(float descent) This will set the descent for the font.- Specified by:
setDescentin classPDFontDescriptor- Parameters:
descent- The new descent for the font.
-
getLeading
public float getLeading()This will get the leading for the font.- Specified by:
getLeadingin classPDFontDescriptor- Returns:
- The leading.
-
setLeading
public void setLeading(float leading) This will set the leading for the font.- Specified by:
setLeadingin classPDFontDescriptor- Parameters:
leading- The new leading for the font.
-
getCapHeight
public float getCapHeight()This will get the CapHeight for the font.- Specified by:
getCapHeightin classPDFontDescriptor- Returns:
- The cap height.
-
setCapHeight
public void setCapHeight(float capHeight) This will set the cap height for the font.- Specified by:
setCapHeightin classPDFontDescriptor- Parameters:
capHeight- The new cap height for the font.
-
getXHeight
public float getXHeight()This will get the x height for the font.- Specified by:
getXHeightin classPDFontDescriptor- Returns:
- The x height.
-
setXHeight
public void setXHeight(float xHeight) This will set the x height for the font.- Specified by:
setXHeightin classPDFontDescriptor- Parameters:
xHeight- The new x height for the font.
-
getStemV
public float getStemV()This will get the stemV for the font.- Specified by:
getStemVin classPDFontDescriptor- Returns:
- The stem v value.
-
setStemV
public void setStemV(float stemV) This will set the stem V for the font.- Specified by:
setStemVin classPDFontDescriptor- Parameters:
stemV- The new stem v for the font.
-
getStemH
public float getStemH()This will get the stemH for the font.- Specified by:
getStemHin classPDFontDescriptor- Returns:
- The stem h value.
-
setStemH
public void setStemH(float stemH) This will set the stem H for the font.- Specified by:
setStemHin classPDFontDescriptor- Parameters:
stemH- The new stem h for the font.
-
getAverageWidth
public float getAverageWidth()This will get the average width for the font.- Specified by:
getAverageWidthin classPDFontDescriptor- Returns:
- The average width value.
-
setAverageWidth
public void setAverageWidth(float averageWidth) This will set the average width for the font.- Specified by:
setAverageWidthin classPDFontDescriptor- Parameters:
averageWidth- The new average width for the font.
-
getMaxWidth
public float getMaxWidth()This will get the max width for the font.- Specified by:
getMaxWidthin classPDFontDescriptor- Returns:
- The max width value.
-
setMaxWidth
public void setMaxWidth(float maxWidth) This will set the max width for the font.- Specified by:
setMaxWidthin classPDFontDescriptor- Parameters:
maxWidth- The new max width for the font.
-
getMissingWidth
public float getMissingWidth()This will get the missing width for the font.- Specified by:
getMissingWidthin classPDFontDescriptor- Returns:
- The missing width value.
-
setMissingWidth
public void setMissingWidth(float missingWidth) This will set the missing width for the font.- Specified by:
setMissingWidthin classPDFontDescriptor- Parameters:
missingWidth- The new missing width for the font.
-
getCharSet
This will get the character set for the font.- Specified by:
getCharSetin classPDFontDescriptor- Returns:
- The character set value.
-
setCharacterSet
This will set the character set for the font.- Specified by:
setCharacterSetin classPDFontDescriptor- Parameters:
charSet- The new character set for the font.
-
getFontFile
A stream containing a Type 1 font program.- Returns:
- A stream containing a Type 1 font program.
-
setFontFile
Set the type 1 font program.- Parameters:
type1Stream- The type 1 stream.
-
getFontFile2
A stream containing a true type font program.- Returns:
- A stream containing a true type font program.
-
setFontFile2
Set the true type font program.- Parameters:
ttfStream- The true type stream.
-
getFontFile3
A stream containing a font program that is not true type or type 1.- Returns:
- A stream containing a font program.
-
setFontFile3
Set a stream containing a font program that is not true type or type 1.- Parameters:
stream- The font program stream.
-