org.pdfbox.pdmodel.font
Class PDSimpleFont
- COSObjectable
public abstract class PDSimpleFont
This class contains implementation details of the simple pdf fonts.
void | drawString(String string, Graphics g, float fontSize, float xScale, float yScale, float x, float y) -
|
float | getAverageFontWidth() - This will get the average font width for all characters.
|
PDRectangle | getFontBoundingBox() - This will get the fonts bounding box.
|
PDFontDescriptor | getFontDescriptor() - This will get the font descriptor for this font.
|
float | getFontHeight(byte[] c, int offset, int length) - This will get the font width for a character.
|
float | getFontWidth(byte[] c, int offset, int length) - This will get the font width for a character.
|
PDStream | getToUnicode() - This will get the ToUnicode stream.
|
void | setFontDescriptor(PDFontDescriptorDictionary fontDescriptor) - This will set the font descriptor.
|
void | setToUnicode(PDStream unicode) - This will set the ToUnicode stream.
|
clearResources , drawString , encode , equals , getAFM , getAverageFontWidth , getAverageFontWidthFromAFMFile , getBaseFont , getCOSObject , getCodeFromArray , getEncoding , getFirstChar , getFontBoundingBox , getFontHeight , getFontMatrix , getFontWidth , getFontWidthFromAFMFile , getLastChar , getStringWidth , getSubType , getType , getWidths , hashCode , setBaseFont , setEncoding , setFirstChar , setLastChar , setWidths |
PDSimpleFont
public PDSimpleFont()
Constructor.
PDSimpleFont
public PDSimpleFont(COSDictionary fontDictionary)
Constructor.
fontDictionary
- The font dictionary according to the PDF specification.
drawString
public void drawString(String string,
Graphics g,
float fontSize,
float xScale,
float yScale,
float x,
float y)
throws IOException
- drawString in interface PDFont
getAverageFontWidth
public float getAverageFontWidth()
throws IOException
This will get the average font width for all characters.
- getAverageFontWidth in interface PDFont
- The width is in 1000 unit of text space, ie 333 or 777
getFontDescriptor
public PDFontDescriptor getFontDescriptor()
throws IOException
This will get the font descriptor for this font.
- The font descriptor for this font.
getFontHeight
public float getFontHeight(byte[] c,
int offset,
int length)
throws IOException
This will get the font width for a character.
- getFontHeight in interface PDFont
c
- The character code to get the width for.offset
- The offset into the array.length
- The length of the data.
- The width is in 1000 unit of text space, ie 333 or 777
getFontWidth
public float getFontWidth(byte[] c,
int offset,
int length)
throws IOException
This will get the font width for a character.
- getFontWidth in interface PDFont
c
- The character code to get the width for.offset
- The offset into the array.length
- The length of the data.
- The width is in 1000 unit of text space, ie 333 or 777
getToUnicode
public PDStream getToUnicode()
throws IOException
This will get the ToUnicode stream.
setFontDescriptor
public void setFontDescriptor(PDFontDescriptorDictionary fontDescriptor)
This will set the font descriptor.
fontDescriptor
- The font descriptor.
setToUnicode
public void setToUnicode(PDStream unicode)
This will set the ToUnicode stream.
unicode
- The unicode stream.