public class TTFParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
isEmbedded |
private boolean |
parseOnDemandOnly |
Constructor and Description |
---|
TTFParser()
Constructor.
|
TTFParser(boolean isEmbedded)
Constructor.
|
TTFParser(boolean isEmbedded,
boolean parseOnDemand)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowCFF() |
(package private) TrueTypeFont |
newFont(TTFDataStream raf) |
TrueTypeFont |
parse(java.io.File ttfFile)
Parse a file and return a TrueType font.
|
TrueTypeFont |
parse(java.io.InputStream inputStream)
Parse an input stream and return a TrueType font.
|
TrueTypeFont |
parse(java.lang.String ttfFile)
Parse a file and return a TrueType font.
|
(package private) TrueTypeFont |
parse(TTFDataStream raf)
Parse a file and get a true type font.
|
TrueTypeFont |
parseEmbedded(java.io.InputStream inputStream)
Parse an input stream and return a TrueType font that is to be embedded.
|
private void |
parseTables(TrueTypeFont font)
Parse all tables and check if all needed tables are present.
|
protected TTFTable |
readTable(TrueTypeFont font,
java.lang.String tag) |
private TTFTable |
readTableDirectory(TrueTypeFont font,
TTFDataStream raf) |
private boolean isEmbedded
private boolean parseOnDemandOnly
public TTFParser()
public TTFParser(boolean isEmbedded)
isEmbedded
- true if the font is embedded in PDFpublic TTFParser(boolean isEmbedded, boolean parseOnDemand)
isEmbedded
- true if the font is embedded in PDFparseOnDemand
- true if the tables of the font should be parsed on demandpublic TrueTypeFont parse(java.lang.String ttfFile) throws java.io.IOException
ttfFile
- The TrueType font filename.java.io.IOException
- If there is an error parsing the TrueType font.public TrueTypeFont parse(java.io.File ttfFile) throws java.io.IOException
ttfFile
- The TrueType font file.java.io.IOException
- If there is an error parsing the TrueType font.public TrueTypeFont parse(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- The TTF data stream to parse from. It will be closed before returning.java.io.IOException
- If there is an error parsing the TrueType font.public TrueTypeFont parseEmbedded(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- The TTF data stream to parse from. It will be closed before returning.java.io.IOException
- If there is an error parsing the TrueType font.TrueTypeFont parse(TTFDataStream raf) throws java.io.IOException
raf
- The TTF file.java.io.IOException
- If there is an error parsing the TrueType font.TrueTypeFont newFont(TTFDataStream raf)
private void parseTables(TrueTypeFont font) throws java.io.IOException
font
- the TrueTypeFont instance holding the parsed data.java.io.IOException
- If there is an error parsing the TrueType font.protected boolean allowCFF()
private TTFTable readTableDirectory(TrueTypeFont font, TTFDataStream raf) throws java.io.IOException
java.io.IOException
protected TTFTable readTable(TrueTypeFont font, java.lang.String tag)