|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.pdmodel.font.PDFont
org.pdfbox.pdmodel.font.PDSimpleFont
public abstract class PDSimpleFont
This class contains implementation details of the simple pdf fonts.
Field Summary |
---|
Fields inherited from class org.pdfbox.pdmodel.font.PDFont |
---|
font |
Constructor Summary | |
---|---|
PDSimpleFont()
Constructor. |
|
PDSimpleFont(COSDictionary fontDictionary)
Constructor. |
Method Summary | |
---|---|
void |
drawString(java.lang.String string,
java.awt.Graphics g,
float fontSize,
float xScale,
float yScale,
float x,
float y)
This will draw a string on a canvas using the font. |
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. |
Methods inherited from class org.pdfbox.pdmodel.font.PDFont |
---|
clearResources, encode, equals, getAFM, getAverageFontWidthFromAFMFile, getBaseFont, getCodeFromArray, getCOSObject, getEncoding, getFirstChar, getFontMatrix, getFontWidthFromAFMFile, getLastChar, getStringWidth, getSubType, getType, getWidths, hashCode, setBaseFont, setEncoding, setFirstChar, setLastChar, setWidths |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDSimpleFont()
public PDSimpleFont(COSDictionary fontDictionary)
fontDictionary
- The font dictionary according to the PDF specification.Method Detail |
---|
public void drawString(java.lang.String string, java.awt.Graphics g, float fontSize, float xScale, float yScale, float x, float y) throws java.io.IOException
drawString
in class PDFont
string
- The string to draw.g
- The graphics to draw onto.fontSize
- The size of the font to draw.xScale
- The x scaling percent.yScale
- The y scaling percent.x
- The x coordinate to draw at.y
- The y coordinate to draw at.
java.io.IOException
- If there is an error drawing the specific string.public float getFontHeight(byte[] c, int offset, int length) throws java.io.IOException
getFontHeight
in class PDFont
c
- The character code to get the width for.offset
- The offset into the array.length
- The length of the data.
java.io.IOException
- If an error occurs while parsing.public float getFontWidth(byte[] c, int offset, int length) throws java.io.IOException
getFontWidth
in class PDFont
c
- The character code to get the width for.offset
- The offset into the array.length
- The length of the data.
java.io.IOException
- If an error occurs while parsing.public float getAverageFontWidth() throws java.io.IOException
getAverageFontWidth
in class PDFont
java.io.IOException
- If an error occurs while parsing.public PDFontDescriptor getFontDescriptor() throws java.io.IOException
java.io.IOException
- If there is an error parsing an AFM file, or unable to
create a PDFontDescriptor object.public void setFontDescriptor(PDFontDescriptorDictionary fontDescriptor)
fontDescriptor
- The font descriptor.public PDStream getToUnicode() throws java.io.IOException
java.io.IOException
- If there is an error getting the stream.public void setToUnicode(PDStream unicode)
unicode
- The unicode stream.public PDRectangle getFontBoundingBox() throws java.io.IOException
getFontBoundingBox
in class PDFont
java.io.IOException
- If there is an error getting the bounding box.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |