org.pdfbox.pdmodel.font
Class PDTrueTypeFont
- COSObjectable
public class PDTrueTypeFont
This is the TrueType implementation of fonts.
static 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.
|
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 |
UNKNOWN_FONT
public static final 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.
PDTrueTypeFont
public PDTrueTypeFont()
Constructor.
PDTrueTypeFont
public PDTrueTypeFont(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 PDSimpleFont
loadTTF
public static PDTrueTypeFont loadTTF(PDDocument doc,
File file)
throws IOException
This will load a TTF to be embedding into a document.
doc
- The PDF document that will hold the embedded font.file
- A TTF file stream.
loadTTF
public static PDTrueTypeFont loadTTF(PDDocument doc,
String file)
throws IOException
This will load a TTF font from a font file.
doc
- The PDF document that will hold the embedded font.file
- The file on the filesystem that holds the font file.