Package org.apache.fontbox.ttf
Class TTFParser
java.lang.Object
org.apache.fontbox.ttf.TTFParser
- Direct Known Subclasses:
OTFParser
TrueType font file parser.
- Author:
- Ben Litchfield
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanallowCFF()parse(org.apache.pdfbox.io.RandomAccessRead randomAccessRead) Parse a RandomAccessRead and return a TrueType font.parseEmbedded(InputStream inputStream) Parse an input stream and return a TrueType font that is to be embedded.parseTableHeaders(org.apache.pdfbox.io.RandomAccessRead randomAccessRead) Parse a RandomAccessRead and return the table headers.protected TTFTable
-
Constructor Details
-
TTFParser
public TTFParser()Constructor. -
TTFParser
public TTFParser(boolean isEmbedded) Constructor.- Parameters:
isEmbedded- true if the font is embedded in PDF
-
-
Method Details
-
parse
public TrueTypeFont parse(org.apache.pdfbox.io.RandomAccessRead randomAccessRead) throws IOException Parse a RandomAccessRead and return a TrueType font.- Parameters:
randomAccessRead- The RandomAccessRead to be read from. It will be closed before returning.- Returns:
- A TrueType font.
- Throws:
IOException- If there is an error parsing the TrueType font.
-
parseEmbedded
Parse an input stream and return a TrueType font that is to be embedded.- Parameters:
inputStream- The TTF data stream to parse from. It will be closed before returning.- Returns:
- A TrueType font.
- Throws:
IOException- If there is an error parsing the TrueType font.
-
parseTableHeaders
public FontHeaders parseTableHeaders(org.apache.pdfbox.io.RandomAccessRead randomAccessRead) throws IOException Parse a RandomAccessRead and return the table headers.- Parameters:
randomAccessRead- The randomAccessRead to be read from. It will be closed before returning.- Returns:
- TrueType font headers.
- Throws:
IOException- If there is an error parsing the TrueType font.
-
allowCFF
protected boolean allowCFF() -
readTable
-