Classes to manipulate OpenType fonts.
represents an OpenType font. Such a font can have either TrueType or CFF
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,
object has one member for each table.
There are also a few utility classes, such as
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
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 Ma.ma, then
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
OpenTypeFontobject is created. This may or may not cause the whole font to be rejected.
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
OpenTypeFontobject is created.
Interface Summary Interface Description Cmap.CmapSelectorClass used to receive the list of recognized subtables in this cmap table. Gasp.BehaviorBits Glyf.CoordFlags Glyf.Flags Os2.SelectionBits
Class Summary Class Description Base CffGives access to a 'CFF' table. CmapGives access to a 'cmap' table. Cmap.MacEncodingID Cmap.MS_EncodingID Cmap.PlatformIDEnum classes for the various platformIDs and encodingIDs. Cmap.UnicodeEncodingID CvtGives access to the 'cvt' table. FetchGlyphNameTT FondGives access to the Apple 'fond' table. FontFactoryCreates font objects for OpenType fonts FpgmGives access to the 'fpgm' table. GaspGives access to the 'gasp' table. GdefGives access to a 'GDEF' table. GlyfGives access to the 'glyf' table. GlyphNamesThis class supports PostScript glyph names. GlyphNamesResourceBuilder GposGives access to the 'GPOS' table. GsubGives access to the 'GSUB' table. HeadGives access to the 'head' table. HheaGives access to the 'hhea' table. HmtxGives access to the 'hmtx' table. KernGives access to the 'kern' table. LayoutTableA LayoutTable is the base class for GSUB/GPOS/GDEF/BASE tables, and captures the common types: coverages, class definitions, etc. LookupTableA LookupTable is the base class for GSUB/GPOS tables. LookupTableHarvester LtshGives access to the 'LTSH' table. MaxpGives access to the 'maxp' table. NameGives access to the 'name' table. Name.LanguageCodeEntry Name.MacintoshEncodingIdThis class defines constants for the Macintosh encoding ids. Name.MacintoshLanguageCode Name.MicrosoftEncodingIdThis class defines constants for the Microsoft encoding ids. Name.MicrosoftLCIDThis class defines constants for the Microsoft language ids. Name.PlatformIdThis class defines constants for the platform ids. Name.PredefinedNamesThis class defines constants for the predefined entries in a 'name' table. OpenTypeFontGives access to an OpenType font OpticalSizeDataRepresents the optical size data for an OpenType font. Orientation Os2Gives access to the 'OS/2' table. Os2.CodePageIdentifies a code page. Os2.UnicodeRangeIdentifies a Unicode range. OTByteArrayA sequence of bytes in an OpenType font file, with methods to access the basic types. OTSelectorDetermine if a feature can be applied at some positions. OTSelectorAtLigatureLevel OTSelectorEverywhere OTSelectorOnElementAttribute OTSelectorsCommon OTSelector objects. OTSubset PDFEncodingBuilderImpl PostGives access to the 'post' table. PrepGives access to the 'prep' table. TableBase class for an OpenType table TagTag manipulation and predefined tags. TrueTypeGlyphBBoxCalculator TTCompositeOutlineA TrueType composite outline. TTCompositeOutline.TTComponent TTInterpreterInterprets TT programs. TTOutlineA TrueType outline. TTPointRepresents a point in a TrueType outline. TTScalerA
Scalerfor OpenType fonts with TrueType outlines.
TTSimpleOutlineA TrueType simple outline. VheaGives access to the 'vhea' table. VmtxGives access to the 'vmtx' table. VorgGives access to the 'VORG' table. ZoneHint