Package org.apache.fontbox.ttf
Class OTFParser
java.lang.Object
org.apache.fontbox.ttf.TTFParser
org.apache.fontbox.ttf.OTFParser
OpenType font file parser.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
allowCFF()
(package private) OpenTypeFont
newFont
(TTFDataStream raf) Parse a file and return a TrueType font.parse
(InputStream data) Parse an input stream and return a TrueType font.Parse a file and return a TrueType font.(package private) OpenTypeFont
parse
(TTFDataStream raf) Parse a file and get a true type font.protected TTFTable
readTable
(TrueTypeFont font, String tag) Methods inherited from class org.apache.fontbox.ttf.TTFParser
parseEmbedded
-
Constructor Details
-
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 Details
-
parse
Description copied from class:TTFParser
Parse a file and return a TrueType font.- Overrides:
parse
in classTTFParser
- Parameters:
file
- The TrueType font filename.- Returns:
- A TrueType font.
- Throws:
IOException
- If there is an error parsing the TrueType font.
-
parse
Description copied from class:TTFParser
Parse a file and return a TrueType font.- Overrides:
parse
in classTTFParser
- Parameters:
file
- The TrueType font file.- Returns:
- A TrueType font.
- Throws:
IOException
- If there is an error parsing the TrueType font.
-
parse
Description copied from class:TTFParser
Parse an input stream and return a TrueType font.- Overrides:
parse
in 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.
-
parse
Description copied from class:TTFParser
Parse a file and get a true type font.- Overrides:
parse
in classTTFParser
- Parameters:
raf
- The TTF file.- Returns:
- A TrueType font.
- Throws:
IOException
- If there is an error parsing the TrueType font.
-
newFont
-
readTable
-
allowCFF
protected boolean allowCFF()
-