Package com.adobe.fontengine.font.opentype

Classes to manipulate OpenType fonts.

The OpenTypeFont class represents an OpenType font. Such a font can have either TrueType or CFF outlines.

The class Container provides one useful (static) method: Container.load to create a bunch of OpenTypeFont from a stream of bytes. Most OpenType byte stream contain a single font, but TTC streams can contain multiple, usually related, fonts.

Each table in an OpenType font has a corresponding class, except for the 'loca' table which is better though of as an adjunct in the 'glyf' table. Typically, the OpenTypeFont object has one member for each table.

There are also a few utility classes, such as Tag.

Format version

OpenType uses versioning to allow for extensions to the format. In general, each table is equipped with a version number, made of a major version and a minor version (there are some tables which have only a minor version, or no version at all). The rule is that backward compatible extensions increment the minor version number, while backward incompatible extensions increment the major version number.

The classes in this package are programmed to fully handle all know format versions at the time they are written. Each class corresponding to a table specifies the format versions is fully handles. For example, the Post class specifies that it handles versions 1.0, 2.0, 2.5, and 3.0. The classes are also programmed to handle unknown version numbers, in the following way: let s(M) be the set of the supported minor version numbers for major version M; if an actual table has version, then

  1. if s(Ma) is the empty set, or if ma is less than any of s(Ma), then the table is rejected at the time the OpenTypeFont object is created. This may or may not cause the whole font to be rejected.
  2. otherwise, the table is interpreted according to minor version m which is the smallif the major version of an actual table is supported, but the actual minor version is not, then the largest If an actual font table has a major version number which is not supported at all, then the table is rejected at the time the OpenTypeFont object is created.