|
||||||||||
| 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.PDTrueTypeFont
public class PDTrueTypeFont
This is the TrueType implementation of fonts.
| Field Summary | |
|---|---|
static String |
UNKNOWN_FONT
This is the key to a property in the PDFBox_External_Fonts.properties file to load a Font when a mapping does not exist for the current font. |
| Fields inherited from class org.apache.pdfbox.pdmodel.font.PDFont |
|---|
cmap, cmapObjects, font, fontMatrix, resourceRootCMAP, toUnicodeCmap |
| Constructor Summary | |
|---|---|
PDTrueTypeFont()
Constructor. |
|
PDTrueTypeFont(COSDictionary fontDictionary)
Constructor. |
|
| Method Summary | |
|---|---|
void |
clear()
Calling this will release all cached information. |
Font |
getawtFont()
Looks up, creates, returns the AWT Font. |
float |
getFontWidth(int charCode)
Determines the width of the given character. |
org.apache.fontbox.ttf.TrueTypeFont |
getTTFFont()
Return the TTF font as TrueTypeFont. |
static PDTrueTypeFont |
loadTTF(PDDocument doc,
File file)
This will load a TTF to be embedded into a document. |
static PDTrueTypeFont |
loadTTF(PDDocument doc,
InputStream stream)
This will load a TTF to be embedded into a document. |
static PDTrueTypeFont |
loadTTF(PDDocument doc,
InputStream stream,
Encoding enc)
This will load a TTF to be embedded into a document. |
static PDTrueTypeFont |
loadTTF(PDDocument doc,
String file)
This will load a TTF font from a font file. |
static PDTrueTypeFont |
loadTTF(PDStream fontStream,
Encoding enc)
This will load a TTF to be embedded into a document. |
| Methods inherited from class org.apache.pdfbox.pdmodel.font.PDSimpleFont |
|---|
determineEncoding, drawString, getAverageFontWidth, getFontBoundingBox, getFontHeight, getFontWidth, getSpaceWidth, getToUnicode, isFontSubstituted, setIsFontSubstituted, setToUnicode, writeFont |
| Methods inherited from class org.apache.pdfbox.pdmodel.font.PDFont |
|---|
clearResources, cmapEncoding, drawString, encode, encodeToCID, equals, getAFM, getAverageFontWidthFromAFMFile, getBaseFont, getCodeFromArray, getCOSObject, getEncoding, getFirstChar, getFontDescriptor, getFontEncoding, getFontMatrix, getFontWidthFromAFMFile, getLastChar, getStringFromArray, getStringWidth, getSubType, getToUnicodeCMap, getType, getWidths, hashCode, hasToUnicode, isSymbolicFont, isType0Font, isType1Font, isType3Font, parseCmap, setBaseFont, setEncoding, setFirstChar, setFontDescriptor, setFontEncoding, setHasToUnicode, setLastChar, setWidths |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String UNKNOWN_FONT
| Constructor Detail |
|---|
public PDTrueTypeFont()
public PDTrueTypeFont(COSDictionary fontDictionary)
throws IOException
fontDictionary - The font dictionary according to the PDF specification.
IOException - exception if something went wrong when loading the font.| Method Detail |
|---|
public static PDTrueTypeFont loadTTF(PDDocument doc,
String file)
throws IOException
doc - The PDF document that will hold the embedded font.file - The file on the filesystem that holds the font file.
IOException - If there is an error loading the file data.
public static PDTrueTypeFont loadTTF(PDDocument doc,
File file)
throws IOException
doc - The PDF document that will hold the embedded font.file - a ttf file.
IOException - If there is an error loading the data.
public static PDTrueTypeFont loadTTF(PDDocument doc,
InputStream stream)
throws IOException
doc - The PDF document that will hold the embedded font.stream - a ttf input stream.
IOException - If there is an error loading the data.
public static PDTrueTypeFont loadTTF(PDDocument doc,
InputStream stream,
Encoding enc)
throws IOException
doc - The PDF document that will hold the embedded font.stream - a ttf input stream.enc - The font encoding.
IOException - If there is an error loading the data.
public static PDTrueTypeFont loadTTF(PDStream fontStream,
Encoding enc)
throws IOException
fontStream - a ttf input stream.enc - The font encoding.
IOException - If there is an error loading the data.
public Font getawtFont()
throws IOException
getawtFont in class PDSimpleFontIOException - if something went wrong.
public org.apache.fontbox.ttf.TrueTypeFont getTTFFont()
throws IOException
IOException - If there is an error loading the datapublic void clear()
PDFont
clear in class PDFontpublic float getFontWidth(int charCode)
PDFont
getFontWidth in class PDFontcharCode - the code of the given character
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||