sfnt
formatsfnt
, after the resource tag the Macintosh uses
internally to track font data. The name sfnt
itself
stands for "spline font".sfnt
is the same format TrueType fonts have used
since they were first introduced on the Macintosh. Under GX, an
sfnt
file can contain a TrueType font, a PostScript Type
1 font, or other information; thus the more general name has been
adopted.
An sfnt
file can take three forms:
The "suitcase" file in which fonts are commonly shipped
File type:
ffil
The individual font file
File type:
tfil
The "bass" file, which includes sfnt
data in the data
fork
File type:
bass
TrueEdit can open all three varieties of sfnt
file
(although it can only edit TrueType fonts). Note that
sfnt
is not the file type, but the tag of the font
resource inside the file.
The sfnt
file format is based on
tables. An sfnt
file may contain many
tables, each of which specifies a single aspect of the font such as
glyph outlines, horizontal metrics, glyph effects, font family names,
or other information.
The tables exist independently, each adding a single piece of
functionality to the font. (A few important interdependencies are
outlined later in this chapter.) In a broad sense, font development
for QuickDraw GX consists simply of adding tables to an
sfnt
.
Each table is identified by a four-letter tag which
abbreviates its function. These tags are similar to those used for
the file types, creator codes, and resource types familiar to
Macintosh programmers. As with those tags, Apple has reserved all
tags consisting of all lowercase letters for its own use.
There are some tags which appear to have three letters, e.g.
cvt
. These tags do in fact contain four characters, the last being a space.
sfnt
table tagsWith the release of QuickDraw GX, 33 standard tables have been defined by Apple. A brief description of each table follows. Full definitions are included in the documents The TrueType Font Format Specification and QuickDraw GX Font Formats.
Tag |
Meaning |
Description | |||||
---|---|---|---|---|---|---|---|
|
Accent attachment |
Compact format for describing composite glyphs where the components are not transformed. | |||||
|
Bitmap data |
Embedded bitmap data for multiple sizes and glyph ranges. | |||||
|
Bitmap location |
Index to embedded bitmap data in | |||||
|
Baseline |
Values which specify alignment between layout runs, used for both inter-script alignment and single-script effects like drop capitals. | |||||
|
Character to index mapping |
Language- and script-specific character-to-glyph mapping. | |||||
|
CVT variation |
Changes to the 'cvt ' table so that instructions can work under GX style variations. | |||||
|
Control value |
List of key values, such as stem weights, referred to by a font's instructions. | |||||
|
Font descriptors |
Font self-identification values used for font and style matching. | |||||
|
Feature name |
Organization of glyph effects into user-visible features, and pointers to their names. | |||||
|
Font metrics |
Basic metrics information in control-point format, so it can be affected by instructions and style variations. | |||||
|
Font program |
Definitions of TrueType functions for use by a font's instructions. | |||||
|
Font variations |
Directory to a font's GX style variation axes and instances. | |||||
|
Glyph data |
Outline and instruction data for each glyph. | |||||
|
Glyph variations |
Point position changes for each glyph under GX style variations. | |||||
|
Horizontal device metrics |
Cached integer metrics for specific pixel-per-em sizes (usually screen sizes). | |||||
|
Font header |
Basic functional information for a font. | |||||
|
Horizontal header |
Basic metrics and functional information for a horizontally-written font. | |||||
|
Horizontal metrics |
Left side bearing and advance width for each glyph (actual data, not a cache). | |||||
|
Justification |
Justification classes, priorities, and actions for glyphs or ranges of glyphs. | |||||
|
Kerning |
Kerning data (context-specific glyph positioning). | |||||
|
Ligature caret |
Insertion point information for glyphs composed of multiple characters. | |||||
|
Index to location |
Location of glyph data within the | |||||
|
Maximum profile |
Basic information on the font's instructions and required system resources. | |||||
|
Glyph metamorphosis |
Glyph effects including contextual and non-contextual substitution, rearrangement, and ligature formation. | |||||
|
Name |
Localized name strings for the font and its effects. | |||||
|
Optical bounds |
Values for each glyph to improve optical alignment at the edges of text. | |||||
|
OS/2 header |
Information required for cross-platform compatibility. | |||||
|
PostScript |
PostScript names for each glyph, for compatibility with PostScript output devices. | |||||
|
Preprogram |
Instructions executed once for each change in font size, transformation, or variation. | |||||
|
Glyph properties |
Unicode directionality class, reordering, and hanging properties for each glyph. | |||||
|
Tracking |
Tracks for size-dependent global adjustment of spacing. | |||||
|
Vertical header |
Basic metrics and functional information for a vertically-written font. | |||||
|
Vertical metrics |
Top bearing and advance height for each glyph. |
Each table within an sfnt
provides a specific element
of functionality to a font. Some of the tables were defined with the
original release of TrueType in 1991, while others are new with
QuickDraw GX.
In addition to Apple, developers of font tools, font formats, and
platforms have used the extensible nature of the sfnt
to
define their own proprietary tables.
A TrueType 1.0 font, also called a simple font, must contain the following nine basic tables for Macintosh compatibility:
Tag
Meaning
cmap
Character to index mapping
glyf
Glyph data
head
Font header
hhea
Horizontal header
hmtx
Horizontal metrics
loca
Index to location
maxp
Maximum profile
name
Name
post
PostScript
TrueType 1.0 defines four additional tables to be used for instruction data:
Tag
Meaning
cvt
Control value
fpgm
Font program
hdmx
Horizontal device metrics
prep
Preprogram
These four tables are optional, and may be omitted if your font contains no instruction data.
TrueType GX defines 19 new tables which may be present in a font.
There is no strict definition of a TrueType GX
font, except that it contains one or more of the tables
defined for GX. The GX tables can be divided into several groups,
according to what kinds of functionality they support. (This is not a
strict division, as some tables support several different kinds of GX
effects.)
Glyph effects are defined in two tables:
Tag
Meaning
feat
Feature name
mort
Glyph metamorphosis
Position effects require six tables:
Tag
Meaning
fmtx
Font metrics
just
Justification
kern
Kerning
lcar
Ligature caret
opbd
Optical bounds
trak
Tracking
Seven tables are used primarily for language and script support:
Tag
Meaning
acnt
Accent attachment
bdat
Bitmap data
bloc
Bitmap location
bsln
Baseline
prop
Glyph properties
vhea
Vertical header
vmtx
Vertical metrics
Style variations use three tables:
Tag
Meaning
cvar
CVT variation
fvar
Font variations
gvar
Glyph variations
The remaining two tables are used for font self-identification:
Tag
Meaning
fdsc
Font descriptors
OS/2
OS/2
Because the table structure is so flexible, many font tools
(including TrueEdit) define their own tables to store additional
tool-specific information in an sfnt
during font
development.
TrueEdit's tables are:
Tag
Meaning
clas
Glyphs may be grouped together into named classes for ease of editing. This table contains those class names and associations. The
clas
table is not an officially defined TrueType GX table.
TRnn
TrueEdit source (where nn is a two-digit number). These tables are used by TrueEdit to store information about user choices for various editors.
Details of the TrueEdit source table formats are included in
Appendix C.
The Apple tool RoyalT defines the tables edt0
and
edt1
to store tool-specific information.
These tables contain no information relevant to the graphics system
or to the end user, and only add to the font's size. Thus these
tables should be stripped from a font before it is shipped to end
users.
Keep a reference copy of the font with all tables intact, for use in later font development.
The sfnt
format was originally developed for TrueType
fonts on the Macintosh. Since then, other sfnt
tables
have been defined for use with other platforms (such as Windows) and
other font formats (such as PostScript Type 1). For more information,
contact the developer of the platform or format.
Although, beginning with GX, PostScript Type 1 fonts for the
Macintosh are shipped in the sfnt
format, TrueEdit does
not support them. You may be able to open the fonts and copy and
paste tables between fonts, but you can't do actual GX development
work.
TrueEdit may prevent you from opening a font which contains Type 1 tables. If you do succeed in opening the font, you should expect TrueEdit to crash at any time.