Package org.apache.fontbox.ttf
Class OpenTypeFont
- java.lang.Object
-
- org.apache.fontbox.ttf.TrueTypeFont
-
- org.apache.fontbox.ttf.OpenTypeFont
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,FontBoxFont
public class OpenTypeFont extends TrueTypeFont
An OpenType (OTF/TTF) font.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisPostScript-
Fields inherited from class org.apache.fontbox.ttf.TrueTypeFont
tables
-
-
Constructor Summary
Constructors Constructor Description OpenTypeFont(TTFDataStream fontData)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CFFTablegetCFF()Get the "CFF" table for this OTF.GlyphTablegetGlyph()Get the glyf table for this TTF.java.awt.geom.GeneralPathgetPath(java.lang.String name)Returns the path for the character with the given name.booleanhasLayoutTables()Returns true if this font uses OpenType Layout (Advanced Typographic) tables.booleanisPostScript()Returns true if this font is a PostScript outline font.(package private) voidsetVersion(float versionValue)Set the version.-
Methods inherited from class org.apache.fontbox.ttf.TrueTypeFont
addTable, close, disableGsubFeature, enableGsubFeature, enableVerticalSubstitutions, finalize, getAdvanceHeight, getAdvanceWidth, getCmap, getFontBBox, getFontMatrix, getGsub, getHeader, getHorizontalHeader, getHorizontalMetrics, getIndexToLocation, getKerning, getMaximumProfile, getName, getNaming, getNumberOfGlyphs, getOriginalData, getOriginalDataSize, getOS2Windows, getPostScript, getTable, getTableBytes, getTableMap, getTables, getUnicodeCmap, getUnicodeCmap, getUnicodeCmapLookup, getUnicodeCmapLookup, getUnitsPerEm, getVersion, getVerticalHeader, getVerticalMetrics, getVerticalOrigin, getWidth, hasGlyph, nameToGID, readTable, toString
-
-
-
-
Constructor Detail
-
OpenTypeFont
OpenTypeFont(TTFDataStream fontData)
Constructor. Clients should use the OTFParser to create a new OpenTypeFont object.- Parameters:
fontData- The font data.
-
-
Method Detail
-
setVersion
void setVersion(float versionValue)
Description copied from class:TrueTypeFontSet the version. Package-private, used by TTFParser only.- Overrides:
setVersionin classTrueTypeFont- Parameters:
versionValue- The version to set.
-
getCFF
public CFFTable getCFF() throws java.io.IOException
Get the "CFF" table for this OTF.- Returns:
- The "CFF" table.
- Throws:
java.io.IOException
-
getGlyph
public GlyphTable getGlyph() throws java.io.IOException
Description copied from class:TrueTypeFontGet the glyf table for this TTF.- Overrides:
getGlyphin classTrueTypeFont- Returns:
- The glyf table or null if it doesn't exist.
- Throws:
java.io.IOException- if there was an error reading the table.
-
getPath
public java.awt.geom.GeneralPath getPath(java.lang.String name) throws java.io.IOExceptionDescription copied from interface:FontBoxFontReturns the path for the character with the given name.- Specified by:
getPathin interfaceFontBoxFont- Overrides:
getPathin classTrueTypeFont- Returns:
- glyph path
- Throws:
java.io.IOException- if the path could not be read
-
isPostScript
public boolean isPostScript()
Returns true if this font is a PostScript outline font.
-
hasLayoutTables
public boolean hasLayoutTables()
Returns true if this font uses OpenType Layout (Advanced Typographic) tables.
-
-