public interface OpenType
The
OpenType interface represents OpenType and
TrueType fonts. This interface makes it possible to obtain
sfnt tables from the font. A particular
Font object can implement this interface.
For more information on TrueType and OpenType fonts, see the OpenType specification. ( http://www.microsoft.com/typography/otspec/ ).
-
Field Summary
Fields Modifier and Type Field Description static intTAG_ACNTAccent attachment.static intTAG_AVARAxis variation.static intTAG_BASEBaseline data.static intTAG_BDATBitmap data.static intTAG_BLOCBitmap location.static intTAG_BSLNBaseline table.static intTAG_CFFCompact font format (Type1 font).static intTAG_CMAPCharacter to glyph mapping.static intTAG_CVARCVT variation.static intTAG_CVTControl value table.static intTAG_DSIGDigital signature.static intTAG_EBDTEmbedded bitmap data.static intTAG_EBLCEmbedded bitmap location.static intTAG_EBSCEmbedded bitmap scaling.static intTAG_FDSCFont descriptors.static intTAG_FEATFeature name.static intTAG_FMTXFont metrics.static intTAG_FPGMFont program.static intTAG_FVARFont variation.static intTAG_GASPGrid-fitting and scan conversion procedure.static intTAG_GDEFGlyph definition.static intTAG_GLYFGlyph data.static intTAG_GPOSGlyph positioning.static intTAG_GSUBGlyph substitution.static intTAG_GVARGlyph variation.static intTAG_HDMXHorizontal device metrics.static intTAG_HEADFont header.static intTAG_HHEAHorizontal metrics header.static intTAG_HMTXHorizontal metrics.static intTAG_JSTFJustification.static intTAG_JUSTJustification.static intTAG_KERNKerning.static intTAG_LCARLigature caret.static intTAG_LOCAIndex to location.static intTAG_LTSHLinear threshold.static intTAG_MAXPMaximum profile.static intTAG_MMFXMultiple master font metrics.static intTAG_MMSDMultiple master supplementary data.static intTAG_MORTGlyph metamorphosis.static intTAG_NAMENaming table.static intTAG_OPBDOptical bounds.static intTAG_OS2OS/2 and Windows specific metrics.static intTAG_PCLTPCL 5 data.static intTAG_POSTPostScript Information.static intTAG_PREPCVT preprogram.static intTAG_PROPGlyph properties.static intTAG_TRAKTracking.static intTAG_TYP1Adobe Type 1 font data.static intTAG_VDMXVertical device metrics.static intTAG_VHEAVertical metrics header.static intTAG_VMTXVertical metrics. -
Method Summary
Modifier and Type Method Description byte[]getFontTable(int sfntTag)Returns the table as an array of bytes for a specified tag.byte[]getFontTable(int sfntTag, int offset, int count)Returns a subset of the table as an array of bytes for a specified tag.byte[]getFontTable(String strSfntTag)Returns the table as an array of bytes for a specified tag.byte[]getFontTable(String strSfntTag, int offset, int count)Returns a subset of the table as an array of bytes for a specified tag.intgetFontTableSize(int sfntTag)Returns the size of the table for a specified tag.intgetFontTableSize(String strSfntTag)Returns the size of the table for a specified tag.intgetVersion()Returns the version of theOpenTypefont. 1.0 is represented as 0x00010000.
-
Field Details
-
TAG_CMAP
static final int TAG_CMAPCharacter to glyph mapping. Table tag "cmap" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_HEAD
static final int TAG_HEADFont header. Table tag "head" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_NAME
static final int TAG_NAMENaming table. Table tag "name" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_GLYF
static final int TAG_GLYFGlyph data. Table tag "glyf" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_MAXP
static final int TAG_MAXPMaximum profile. Table tag "maxp" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_PREP
static final int TAG_PREPCVT preprogram. Table tag "prep" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_HMTX
static final int TAG_HMTXHorizontal metrics. Table tag "hmtx" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_KERN
static final int TAG_KERNKerning. Table tag "kern" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_HDMX
static final int TAG_HDMXHorizontal device metrics. Table tag "hdmx" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_LOCA
static final int TAG_LOCAIndex to location. Table tag "loca" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_POST
static final int TAG_POSTPostScript Information. Table tag "post" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_OS2
static final int TAG_OS2OS/2 and Windows specific metrics. Table tag "OS/2" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_CVT
static final int TAG_CVTControl value table. Table tag "cvt " in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_GASP
static final int TAG_GASPGrid-fitting and scan conversion procedure. Table tag "gasp" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_VDMX
static final int TAG_VDMXVertical device metrics. Table tag "VDMX" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_VMTX
static final int TAG_VMTXVertical metrics. Table tag "vmtx" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_VHEA
static final int TAG_VHEAVertical metrics header. Table tag "vhea" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_HHEA
static final int TAG_HHEAHorizontal metrics header. Table tag "hhea" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_TYP1
static final int TAG_TYP1Adobe Type 1 font data. Table tag "typ1" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_BSLN
static final int TAG_BSLNBaseline table. Table tag "bsln" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_GSUB
static final int TAG_GSUBGlyph substitution. Table tag "GSUB" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_DSIG
static final int TAG_DSIGDigital signature. Table tag "DSIG" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_FPGM
static final int TAG_FPGMFont program. Table tag "fpgm" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_FVAR
static final int TAG_FVARFont variation. Table tag "fvar" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_GVAR
static final int TAG_GVARGlyph variation. Table tag "gvar" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_CFF
static final int TAG_CFFCompact font format (Type1 font). Table tag "CFF " in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_MMSD
static final int TAG_MMSDMultiple master supplementary data. Table tag "MMSD" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_MMFX
static final int TAG_MMFXMultiple master font metrics. Table tag "MMFX" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_BASE
static final int TAG_BASEBaseline data. Table tag "BASE" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_GDEF
static final int TAG_GDEFGlyph definition. Table tag "GDEF" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_GPOS
static final int TAG_GPOSGlyph positioning. Table tag "GPOS" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_JSTF
static final int TAG_JSTFJustification. Table tag "JSTF" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_EBDT
static final int TAG_EBDTEmbedded bitmap data. Table tag "EBDT" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_EBLC
static final int TAG_EBLCEmbedded bitmap location. Table tag "EBLC" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_EBSC
static final int TAG_EBSCEmbedded bitmap scaling. Table tag "EBSC" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_LTSH
static final int TAG_LTSHLinear threshold. Table tag "LTSH" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_PCLT
static final int TAG_PCLTPCL 5 data. Table tag "PCLT" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_ACNT
static final int TAG_ACNTAccent attachment. Table tag "acnt" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_AVAR
static final int TAG_AVARAxis variation. Table tag "avar" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_BDAT
static final int TAG_BDATBitmap data. Table tag "bdat" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_BLOC
static final int TAG_BLOCBitmap location. Table tag "bloc" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_CVAR
static final int TAG_CVARCVT variation. Table tag "cvar" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_FEAT
static final int TAG_FEATFeature name. Table tag "feat" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_FDSC
static final int TAG_FDSCFont descriptors. Table tag "fdsc" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_FMTX
static final int TAG_FMTXFont metrics. Table tag "fmtx" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_JUST
static final int TAG_JUSTJustification. Table tag "just" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_LCAR
static final int TAG_LCARLigature caret. Table tag "lcar" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_MORT
static final int TAG_MORTGlyph metamorphosis. Table tag "mort" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_OPBD
static final int TAG_OPBDOptical bounds. Table tag "opbd" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_PROP
static final int TAG_PROPGlyph properties. Table tag "prop" in the Open Type Specification.- See Also:
- Constant Field Values
-
TAG_TRAK
static final int TAG_TRAKTracking. Table tag "trak" in the Open Type Specification.- See Also:
- Constant Field Values
-
-
Method Details
-
getVersion
int getVersion()Returns the version of theOpenTypefont. 1.0 is represented as 0x00010000.- Returns:
- the version of the
OpenTypefont.
-
getFontTable
byte[] getFontTable(int sfntTag)Returns the table as an array of bytes for a specified tag. Tags for sfnt tables include items like cmap, name and head. Thebytearray returned is a copy of the font data in memory.- Parameters:
sfntTag- a four-character code as a 32-bit integer- Returns:
- a
bytearray that is the table that contains the font data corresponding to the specified tag.
-
getFontTable
Returns the table as an array of bytes for a specified tag. Tags for sfnt tables include items like cmap, name and head. The byte array returned is a copy of the font data in memory.- Parameters:
strSfntTag- a four-character code as aString- Returns:
- a
bytearray that is the table that contains the font data corresponding to the specified tag.
-
getFontTable
byte[] getFontTable(int sfntTag, int offset, int count)Returns a subset of the table as an array of bytes for a specified tag. Tags for sfnt tables include items like cmap, name and head. The byte array returned is a copy of the font data in memory.- Parameters:
sfntTag- a four-character code as a 32-bit integeroffset- index of first byte to return from tablecount- number of bytes to return from table- Returns:
- a subset of the table corresponding to
sfntTagand containing the bytes starting atoffsetbyte and includingcountbytes.
-
getFontTable
Returns a subset of the table as an array of bytes for a specified tag. Tags for sfnt tables include items like cmap, name and head. Thebytearray returned is a copy of the font data in memory.- Parameters:
strSfntTag- a four-character code as aStringoffset- index of first byte to return from tablecount- number of bytes to return from table- Returns:
- a subset of the table corresponding to
strSfntTagand containing the bytes starting atoffsetbyte and includingcountbytes.
-
getFontTableSize
int getFontTableSize(int sfntTag)Returns the size of the table for a specified tag. Tags for sfnt tables include items like cmap, name and head.- Parameters:
sfntTag- a four-character code as a 32-bit integer- Returns:
- the size of the table corresponding to the specified tag.
-
getFontTableSize
Returns the size of the table for a specified tag. Tags for sfnt tables include items like cmap, name and head.- Parameters:
strSfntTag- a four-character code as aString- Returns:
- the size of the table corresponding to the specified tag.
-