|
||||||||||
| 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
org.pdfbox.pdmodel.font.PDTrueTypeFont
public class PDTrueTypeFont
This is the TrueType implementation of fonts.
| Field Summary | |
|---|---|
static java.lang.String |
UNKNOWN_FONT
This is the key to a property in the Resources/PDFBox_External_Fonts.properties file to load a Font when a mapping does not exist for the current font. |
| Fields inherited from class org.pdfbox.pdmodel.font.PDFont |
|---|
font |
| Constructor Summary | |
|---|---|
PDTrueTypeFont()
Constructor. |
|
PDTrueTypeFont(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. |
static PDTrueTypeFont |
loadTTF(PDDocument doc,
java.io.File file)
This will load a TTF to be embedding into a document. |
static PDTrueTypeFont |
loadTTF(PDDocument doc,
java.lang.String file)
This will load a TTF font from a font file. |
| Methods inherited from class org.pdfbox.pdmodel.font.PDSimpleFont |
|---|
getAverageFontWidth, getFontBoundingBox, getFontDescriptor, getFontHeight, getFontWidth, getToUnicode, setFontDescriptor, setToUnicode |
| 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 |
| Field Detail |
|---|
public static final java.lang.String UNKNOWN_FONT
| Constructor Detail |
|---|
public PDTrueTypeFont()
public PDTrueTypeFont(COSDictionary fontDictionary)
fontDictionary - The font dictionary according to the PDF specification.| Method Detail |
|---|
public static PDTrueTypeFont loadTTF(PDDocument doc,
java.lang.String file)
throws java.io.IOException
doc - The PDF document that will hold the embedded font.file - The file on the filesystem that holds the font file.
java.io.IOException - If there is an error loading the file data.
public static PDTrueTypeFont loadTTF(PDDocument doc,
java.io.File file)
throws java.io.IOException
doc - The PDF document that will hold the embedded font.file - A TTF file stream.
java.io.IOException - If there is an error loading the data.
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 PDSimpleFontstring - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||