public interface

OpenType

java.awt.font.OpenType

Class Overview

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 fonts, see the Apple TrueType Reference Manual ( http://fonts.apple.com/TTRefMan/index.html ).

Summary

Constants
int TAG_ACNT Accent attachment.
int TAG_AVAR Axis variaiton.
int TAG_BASE Baseline data.
int TAG_BDAT Bitmap data.
int TAG_BLOC Bitmap location.
int TAG_BSLN Baseline table.
int TAG_CFF Compact font format (Type1 font).
int TAG_CMAP Character to glyph mapping.
int TAG_CVAR CVT variation.
int TAG_CVT Control value table.
int TAG_DSIG Digital signature.
int TAG_EBDT Embedded bitmap data.
int TAG_EBLC Embedded bitmap location.
int TAG_EBSC Embedded bitmap scaling.
int TAG_FDSC Font descriptors.
int TAG_FEAT Feature name.
int TAG_FMTX Font metrics.
int TAG_FPGM Font program.
int TAG_FVAR Font variation.
int TAG_GASP Grid-fitting and scan conversion procedure.
int TAG_GDEF Glyph definition.
int TAG_GLYF Glyph data.
int TAG_GPOS Glyph positioning.
int TAG_GSUB Glyph substitution.
int TAG_GVAR Glyph variation.
int TAG_HDMX Horizontal device metrics.
int TAG_HEAD Font header.
int TAG_HHEA Horizontal metrics header.
int TAG_HMTX Horizontal metrics.
int TAG_JSTF Justification.
int TAG_JUST Justification.
int TAG_KERN Kerning.
int TAG_LCAR Ligature caret.
int TAG_LOCA Index to location.
int TAG_LTSH Linear threshold.
int TAG_MAXP Maximum profile.
int TAG_MMFX Multiple master font metrics.
int TAG_MMSD Multiple master supplementary data.
int TAG_MORT Glyph metamorphosis.
int TAG_NAME Naming table.
int TAG_OPBD Optical bounds.
int TAG_OS2 OS/2 and Windows specific metrics.
int TAG_PCLT PCL 5 data.
int TAG_POST PostScript Information.
int TAG_PREP CVT preprogram.
int TAG_PROP Glyph properties.
int TAG_TRAK Tracking.
int TAG_TYP1 Adobe Type 1 font data.
int TAG_VDMX Vertical device metrics.
int TAG_VHEA Vertical metrics header.
int TAG_VMTX Vertical metrics.
Public Methods
abstract byte[] getFontTable(int sfntTag, int offset, int count)
Returns a subset of the table as an array of bytes for a specified tag.
abstract byte[] getFontTable(String strSfntTag)
Returns the table as an array of bytes for a specified tag.
abstract byte[] getFontTable(int sfntTag)
Returns the table as an array of bytes for a specified tag.
abstract byte[] getFontTable(String strSfntTag, int offset, int count)
Returns a subset of the table as an array of bytes for a specified tag.
abstract int getFontTableSize(int sfntTag)
Returns the size of the table for a specified tag.
abstract int getFontTableSize(String strSfntTag)
Returns the size of the table for a specified tag.
abstract int getVersion()
Returns the version of the OpenType font.

Constants

public static final int TAG_ACNT

Accent attachment. Table tag "acnt" in the Open Type Specification.

Constant Value: 1633906292 (0x61636e74)

public static final int TAG_AVAR

Axis variaiton. Table tag "avar" in the Open Type Specification.

Constant Value: 1635148146 (0x61766172)

public static final int TAG_BASE

Baseline data. Table tag "BASE" in the Open Type Specification.

Constant Value: 1111577413 (0x42415345)

public static final int TAG_BDAT

Bitmap data. Table tag "bdat" in the Open Type Specification.

Constant Value: 1650745716 (0x62646174)

public static final int TAG_BLOC

Bitmap location. Table tag "bloc" in the Open Type Specification.

Constant Value: 1651273571 (0x626c6f63)

public static final int TAG_BSLN

Baseline table. Table tag "bsln" in the Open Type Specification.

Constant Value: 1651731566 (0x62736c6e)

public static final int TAG_CFF

Compact font format (Type1 font). Table tag "CFF " in the Open Type Specification.

Constant Value: 1128678944 (0x43464620)

public static final int TAG_CMAP

Character to glyph mapping. Table tag "cmap" in the Open Type Specification.

Constant Value: 1668112752 (0x636d6170)

public static final int TAG_CVAR

CVT variation. Table tag "cvar" in the Open Type Specification.

Constant Value: 1668702578 (0x63766172)

public static final int TAG_CVT

Control value table. Table tag "cvt " in the Open Type Specification.

Constant Value: 1668707360 (0x63767420)

public static final int TAG_DSIG

Digital signature. Table tag "DSIG" in the Open Type Specification.

Constant Value: 1146308935 (0x44534947)

public static final int TAG_EBDT

Embedded bitmap data. Table tag "EBDT" in the Open Type Specification.

Constant Value: 1161970772 (0x45424454)

public static final int TAG_EBLC

Embedded bitmap location. Table tag "EBLC" in the Open Type Specification.

Constant Value: 1161972803 (0x45424c43)

public static final int TAG_EBSC

Embedded bitmap scaling. Table tag "EBSC" in the Open Type Specification.

Constant Value: 1161974595 (0x45425343)

public static final int TAG_FDSC

Font descriptors. Table tag "fdsc" in the Open Type Specification.

Constant Value: 1717859171 (0x66647363)

public static final int TAG_FEAT

Feature name. Table tag "feat" in the Open Type Specification.

Constant Value: 1717920116 (0x66656174)

public static final int TAG_FMTX

Font metrics. Table tag "fmtx" in the Open Type Specification.

Constant Value: 1718449272 (0x666d7478)

public static final int TAG_FPGM

Font program. Table tag "fpgm" in the Open Type Specification.

Constant Value: 1718642541 (0x6670676d)

public static final int TAG_FVAR

Font variation. Table tag "fvar" in the Open Type Specification.

Constant Value: 1719034226 (0x66766172)

public static final int TAG_GASP

Grid-fitting and scan conversion procedure. Table tag "gasp" in the Open Type Specification.

Constant Value: 1734439792 (0x67617370)

public static final int TAG_GDEF

Glyph definition. Table tag "GDEF" in the Open Type Specification.

Constant Value: 1195656518 (0x47444546)

public static final int TAG_GLYF

Glyph data. Table tag "glyf" in the Open Type Specification.

Constant Value: 1735162214 (0x676c7966)

public static final int TAG_GPOS

Glyph positioning. Table tag "GPOS" in the Open Type Specification.

Constant Value: 1196445523 (0x47504f53)

public static final int TAG_GSUB

Glyph substitution. Table tag "GSUB" in the Open Type Specification.

Constant Value: 1196643650 (0x47535542)

public static final int TAG_GVAR

Glyph variation. Table tag "gvar" in the Open Type Specification.

Constant Value: 1735811442 (0x67766172)

public static final int TAG_HDMX

Horizontal device metrics. Table tag "hdmx" in the Open Type Specification.

Constant Value: 1751412088 (0x68646d78)

public static final int TAG_HEAD

Font header. Table tag "head" in the Open Type Specification.

Constant Value: 1751474532 (0x68656164)

public static final int TAG_HHEA

Horizontal metrics header. Table tag "hhea" in the Open Type Specification.

Constant Value: 1751672161 (0x68686561)

public static final int TAG_HMTX

Horizontal metrics. Table tag "hmtx" in the Open Type Specification.

Constant Value: 1752003704 (0x686d7478)

public static final int TAG_JSTF

Justification. Table tag "JSTF" in the Open Type Specification.

Constant Value: 1246975046 (0x4a535446)

public static final int TAG_JUST

Justification. Table tag "just" in the Open Type Specification.

Constant Value: 1786082164 (0x6a757374)

public static final int TAG_KERN

Kerning. Table tag "kern" in the Open Type Specification.

Constant Value: 1801810542 (0x6b65726e)

public static final int TAG_LCAR

Ligature caret. Table tag "lcar" in the Open Type Specification.

Constant Value: 1818452338 (0x6c636172)

public static final int TAG_LOCA

Index to location. Table tag "loca" in the Open Type Specification.

Constant Value: 1819239265 (0x6c6f6361)

public static final int TAG_LTSH

Linear threshold. Table tag "LTSH" in the Open Type Specification.

Constant Value: 1280594760 (0x4c545348)

public static final int TAG_MAXP

Maximum profile. Table tag "maxp" in the Open Type Specification.

Constant Value: 1835104368 (0x6d617870)

public static final int TAG_MMFX

Multiple master font metrics. Table tag "MMFX" in the Open Type Specification.

Constant Value: 1296909912 (0x4d4d4658)

public static final int TAG_MMSD

Multiple master supplementary data. Table tag "MMSD" in the Open Type Specification.

Constant Value: 1296913220 (0x4d4d5344)

public static final int TAG_MORT

Glyph metamorphosis. Table tag "mort" in the Open Type Specification.

Constant Value: 1836020340 (0x6d6f7274)

public static final int TAG_NAME

Naming table. Table tag "name" in the Open Type Specification.

Constant Value: 1851878757 (0x6e616d65)

public static final int TAG_OPBD

Optical bounds. Table tag "opbd" in the Open Type Specification.

Constant Value: 1836020340 (0x6d6f7274)

public static final int TAG_OS2

OS/2 and Windows specific metrics. Table tag "OS/2" in the Open Type Specification.

Constant Value: 1330851634 (0x4f532f32)

public static final int TAG_PCLT

PCL 5 data. Table tag "PCLT" in the Open Type Specification.

Constant Value: 1346587732 (0x50434c54)

public static final int TAG_POST

PostScript Information. Table tag "post" in the Open Type Specification.

Constant Value: 1886352244 (0x706f7374)

public static final int TAG_PREP

CVT preprogram. Table tag "prep" in the Open Type Specification.

Constant Value: 1886545264 (0x70726570)

public static final int TAG_PROP

Glyph properties. Table tag "prop" in the Open Type Specification.

Constant Value: 1886547824 (0x70726f70)

public static final int TAG_TRAK

Tracking. Table tag "trak" in the Open Type Specification.

Constant Value: 1953653099 (0x7472616b)

public static final int TAG_TYP1

Adobe Type 1 font data. Table tag "typ1" in the Open Type Specification.

Constant Value: 1954115633 (0x74797031)

public static final int TAG_VDMX

Vertical device metrics. Table tag "VDMX" in the Open Type Specification.

Constant Value: 1447316824 (0x56444d58)

public static final int TAG_VHEA

Vertical metrics header. Table tag "vhea" in the Open Type Specification.

Constant Value: 1986553185 (0x76686561)

public static final int TAG_VMTX

Vertical metrics. Table tag "vmtx" in the Open Type Specification.

Constant Value: 1986884728 (0x766d7478)

Public Methods

public abstract 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 integer
offset index of first byte to return from table
count number of bytes to return from table
Returns
  • a subset of the table corresponding to sfntTag and containing the bytes starting at offset byte and including count bytes.

public abstract byte[] getFontTable (String strSfntTag)

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 a String
Returns
  • a byte array that is the table that contains the font data corresponding to the specified tag.

public abstract 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. The byte array returned is a copy of the font data in memory.

Parameters
sfntTag a four-character code as a 32-bit integer
Returns
  • a byte array that is the table that contains the font data corresponding to the specified tag.

public abstract byte[] getFontTable (String strSfntTag, 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
strSfntTag a four-character code as a String
offset index of first byte to return from table
count number of bytes to return from table
Returns
  • a subset of the table corresponding to strSfntTag and containing the bytes starting at offset byte and including count bytes.

public abstract 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.

public abstract int getFontTableSize (String strSfntTag)

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 a String
Returns
  • the size of the table corresponding to the specified tag.

public abstract int getVersion ()

Returns the version of the OpenType font. 1.0 is represented as 0x00010000.

Returns
  • the version of the OpenType font.