Package org.apache.fontbox.ttf
Class TTFParser
- java.lang.Object
-
- org.apache.fontbox.ttf.TTFParser
-
- Direct Known Subclasses:
OTFParser
public class TTFParser extends java.lang.ObjectTrueType font file parser.- Author:
- Ben Litchfield
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanallowCFF()TrueTypeFontparse(org.apache.pdfbox.io.RandomAccessRead randomAccessRead)Parse a RandomAccessRead and return a TrueType font.TrueTypeFontparseEmbedded(java.io.InputStream inputStream)Parse an input stream and return a TrueType font that is to be embedded.FontHeadersparseTableHeaders(org.apache.pdfbox.io.RandomAccessRead randomAccessRead)Parse a RandomAccessRead and return the table headers.protected TTFTablereadTable(java.lang.String tag)
-
-
-
Method Detail
-
parse
public TrueTypeFont parse(org.apache.pdfbox.io.RandomAccessRead randomAccessRead) throws java.io.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:
java.io.IOException- If there is an error parsing the TrueType font.
-
parseEmbedded
public TrueTypeFont parseEmbedded(java.io.InputStream inputStream) throws java.io.IOException
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:
java.io.IOException- If there is an error parsing the TrueType font.
-
parseTableHeaders
public FontHeaders parseTableHeaders(org.apache.pdfbox.io.RandomAccessRead randomAccessRead) throws java.io.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:
java.io.IOException- If there is an error parsing the TrueType font.
-
allowCFF
protected boolean allowCFF()
-
readTable
protected TTFTable readTable(java.lang.String tag)
-
-