|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pdfbox.pdmodel.font.PDFont
org.apache.pdfbox.pdmodel.font.PDSimpleFont
org.apache.pdfbox.pdmodel.font.PDType1Font
org.apache.pdfbox.pdmodel.font.PDType0Font
public class PDType0Font
This is implementation of the Type0 Font. Note that currently this class simply falls back to the Type1 font implementation when drawing text. See PDFBOX-605 for the related improvement issue.
| Field Summary |
|---|
| Fields inherited from class org.apache.pdfbox.pdmodel.font.PDType1Font |
|---|
COURIER, COURIER_BOLD, COURIER_BOLD_OBLIQUE, COURIER_OBLIQUE, HELVETICA, HELVETICA_BOLD, HELVETICA_BOLD_OBLIQUE, HELVETICA_OBLIQUE, SYMBOL, TIMES_BOLD, TIMES_BOLD_ITALIC, TIMES_ITALIC, TIMES_ROMAN, ZAPF_DINGBATS |
| Fields inherited from class org.apache.pdfbox.pdmodel.font.PDFont |
|---|
font |
| Constructor Summary | |
|---|---|
PDType0Font()
Constructor. |
|
PDType0Font(COSDictionary fontDictionary)
Constructor. |
|
| Method Summary | |
|---|---|
void |
drawString(String string,
Graphics g,
float fontSize,
AffineTransform at,
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 bouding box. |
float |
getFontHeight(byte[] c,
int offset,
int length)
This will get the font height for a character. |
float |
getFontWidth(byte[] c,
int offset,
int length)
This will get the font width for a character. |
| Methods inherited from class org.apache.pdfbox.pdmodel.font.PDType1Font |
|---|
getawtFont, getStandard14Names, getStandardFont |
| Methods inherited from class org.apache.pdfbox.pdmodel.font.PDSimpleFont |
|---|
getFontDescriptor, getToUnicode, setFontDescriptor, setToUnicode, writeFont |
| Methods inherited from class org.apache.pdfbox.pdmodel.font.PDFont |
|---|
clearResources, encode, equals, getAFM, getAverageFontWidthFromAFMFile, getBaseFont, getCodeFromArray, getCOSObject, getEncoding, getEncodingManager, 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 PDType0Font()
public PDType0Font(COSDictionary fontDictionary)
fontDictionary - The font dictionary according to the PDF specification.| Method Detail |
|---|
public void drawString(String string,
Graphics g,
float fontSize,
AffineTransform at,
float x,
float y)
throws IOException
drawString in class PDSimpleFontstring - The string to draw.g - The graphics to draw onto.fontSize - The size of the font to draw.at - The transformation matrix with all infos for scaling and shearing of the font.x - The x coordinate to draw at.y - The y coordinate to draw at.
IOException - If there is an error drawing the specific string.
public PDRectangle getFontBoundingBox()
throws IOException
getFontBoundingBox in class PDSimpleFontIOException - If there is an error getting the bounding box.
public float getFontWidth(byte[] c,
int offset,
int length)
throws IOException
getFontWidth in class PDSimpleFontc - The character code to get the width for.offset - The offset into the array.length - The length of the data.
IOException - If an error occurs while parsing.
public float getFontHeight(byte[] c,
int offset,
int length)
throws IOException
getFontHeight in class PDSimpleFontc - The character code to get the height for.offset - The offset into the array.length - The length of the data.
IOException - If an error occurs while parsing.
public float getAverageFontWidth()
throws IOException
getAverageFontWidth in class PDSimpleFontIOException - If an error occurs while parsing.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||