Top Description Fields Constructors Methods
org.apache.fontbox.ttf

public Class OpenTypeFont

extends TrueTypeFont
Class Inheritance
Imports
java.awt.geom.GeneralPath, java.io.IOException

An OpenType (OTF/TTF) font.

Field Summary

Modifier and TypeField and Description
private boolean
Inherited from org.apache.fontbox.ttf.TrueTypeFont:
tables

Constructor Summary

AccessConstructor and Description
pack-priv
OpenTypeFont(TTFDataStream
The font data.
fontData
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public CFFTable

Returns:

The "CFF" table.
getCFF
()

Get the "CFF" table for this OTF.

public GlyphTable
getGlyph()

Overrides org.apache.fontbox.ttf.TrueTypeFont.getGlyph.

Get the glyf table for this TTF.

public GeneralPath
getPath(String
PostScript glyph name
name
)

Overrides org.apache.fontbox.ttf.TrueTypeFont.getPath.

Implements org.apache.fontbox.FontBoxFont.getPath.

Returns the path for the character with the given name.

public boolean

Returns:

true if the font has any layout table, otherwise false
hasLayoutTables
()

Returns true if this font uses OpenType Layout (Advanced Typographic) tables.

public boolean

Returns:

true if the font is a PostScript outline font, otherwise false
isPostScript
()

Returns true if this font is a PostScript outline font.

public boolean

Returns:

true if the font is supported
isSupportedOTF
()

Returns true if this font is supported.

pack-priv void
setVersion(float
The version to set.
versionValue
)

Overrides org.apache.fontbox.ttf.TrueTypeFont.setVersion.

Set the version.

Inherited from org.apache.fontbox.ttf.TrueTypeFont:
addTableclosedisableGsubFeatureenableGsubFeatureenableVerticalSubstitutionsgetAdvanceHeightgetAdvanceWidthgetCmapgetFontBBoxgetFontMatrixgetGsubgetGsubDatagetHeadergetHorizontalHeadergetHorizontalMetricsgetIndexToLocationgetKerninggetMaximumProfilegetNamegetNaminggetNumberOfGlyphsgetOriginalDatagetOriginalDataSizegetOS2WindowsgetPostScriptgetTablegetTableBytesgetTableMapgetTableNBytesgetTablesgetUnicodeCmapLookupgetUnicodeCmapLookupgetUnitsPerEmgetVersiongetVerticalHeadergetVerticalMetricsgetVerticalOrigingetWidthhasGlyphisEnableGsubnameToGIDreadTablereadTableHeaderssetEnableGsubtoString

Field Detail

hasPostScriptTagback to summary
private boolean hasPostScriptTag

Constructor Detail

OpenTypeFontback to summary
pack-priv OpenTypeFont(TTFDataStream fontData)

Constructor. Clients should use the OTFParser to create a new OpenTypeFont object.

Parameters
fontData:TTFDataStream

The font data.

Method Detail

getCFFback to summary
public CFFTable getCFF() throws IOException

Get the "CFF" table for this OTF.

Returns:CFFTable

The "CFF" table.

Exceptions
IOException:
if the font data could not be read
UnsupportedOperationException:
if the current font isn't a CFF font
getGlyphback to summary
public GlyphTable getGlyph() throws IOException

Overrides org.apache.fontbox.ttf.TrueTypeFont.getGlyph.

Doc from org.apache.fontbox.ttf.TrueTypeFont.getGlyph.

Get the glyf table for this TTF.

Returns:GlyphTable

The glyf table or null if it doesn't exist.

Annotations
@Override
Exceptions
IOException:
if there was an error reading the table.
getPathback to summary
public GeneralPath getPath(String name) throws IOException

Overrides org.apache.fontbox.ttf.TrueTypeFont.getPath.

Implements org.apache.fontbox.FontBoxFont.getPath.

Doc from org.apache.fontbox.FontBoxFont.getPath.

Returns the path for the character with the given name.

Parameters
name:String

PostScript glyph name

Returns:GeneralPath

glyph path

Annotations
@Override
Exceptions
IOException:
if the path could not be read
hasLayoutTablesback to summary
public boolean hasLayoutTables()

Returns true if this font uses OpenType Layout (Advanced Typographic) tables.

Returns:boolean

true if the font has any layout table, otherwise false

isPostScriptback to summary
public boolean isPostScript()

Returns true if this font is a PostScript outline font.

Returns:boolean

true if the font is a PostScript outline font, otherwise false

isSupportedOTFback to summary
public boolean isSupportedOTF()

Returns true if this font is supported. There are 3 kind of OpenType fonts, fonts using TrueType outlines, fonts using CFF outlines (version 1 and 2) Fonts using CFF outlines version 2 aren't supported yet.

Returns:boolean

true if the font is supported

setVersionback to summary
pack-priv void setVersion(float versionValue)

Overrides org.apache.fontbox.ttf.TrueTypeFont.setVersion.

Doc from org.apache.fontbox.ttf.TrueTypeFont.setVersion.

Set the version. Package-private, used by TTFParser only.

Parameters
versionValue:float

The version to set.

Annotations
@Override