Package com.tom_roush.fontbox.ttf
Class OTFParser
- java.lang.Object
-
- com.tom_roush.fontbox.ttf.TTFParser
-
- com.tom_roush.fontbox.ttf.OTFParser
-
public final class OTFParser extends TTFParser
OpenType font file parser.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanallowCFF()OpenTypeFontparse(File file)Parse a file and return a TrueType font.OpenTypeFontparse(InputStream data)Parse an input stream and return a TrueType font.OpenTypeFontparse(String file)Parse a file and return a TrueType font.protected TTFTablereadTable(TrueTypeFont font, String tag)-
Methods inherited from class com.tom_roush.fontbox.ttf.TTFParser
parseEmbedded
-
-
-
-
Constructor Detail
-
OTFParser
public OTFParser()
Constructor.
-
OTFParser
public OTFParser(boolean isEmbedded)
Constructor.- Parameters:
isEmbedded- true if the font is embedded in PDF
-
OTFParser
public OTFParser(boolean isEmbedded, boolean parseOnDemand)Constructor.- Parameters:
isEmbedded- true if the font is embedded in PDFparseOnDemand- true if the tables of the font should be parsed on demand
-
-
Method Detail
-
parse
public OpenTypeFont parse(String file) throws IOException
Description copied from class:TTFParserParse a file and return a TrueType font.- Overrides:
parsein classTTFParser- Parameters:
file- The TrueType font filename.- Returns:
- A TrueType font.
- Throws:
IOException- If there is an error parsing the TrueType font.
-
parse
public OpenTypeFont parse(File file) throws IOException
Description copied from class:TTFParserParse a file and return a TrueType font.- Overrides:
parsein classTTFParser- Parameters:
file- The TrueType font file.- Returns:
- A TrueType font.
- Throws:
IOException- If there is an error parsing the TrueType font.
-
parse
public OpenTypeFont parse(InputStream data) throws IOException
Description copied from class:TTFParserParse an input stream and return a TrueType font.- Overrides:
parsein classTTFParser- Parameters:
data- 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.
-
readTable
protected TTFTable readTable(TrueTypeFont font, String tag)
-
-