Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 4 - Font Manager / Font Manager Reference


The Outline Font ('sfnt') Resource

The outline font ('sfnt') resource, which describes a TrueType outline font, consists of a sequence of tables that contain the data necessary for drawing the glyphs of the font, measurement information about the font, and any instructions that the font designer might include. These tables can appear in any order in the resource. Some of the tables are required, such as the description of the font's glyphs, and others are optional, such as kerning information. TrueType outline fonts are available on platforms other than the Macintosh computer, and some tables reflect the variety of information needed for these different operating systems. A table directory at the beginning of the outline font resource contains a version number and keys to access the tables.

Note
There are no data type definitions of the outline font resource tables and there are no fields, although the divisions of the tables are referred to as fields in this chapter. You must access the data using the routines and data structures that are described in this chapter or write table-specific code. Listing 4-2 beginning on page 4-72 shows how to read the contents of the various tables.
The Font Manager uses some of the tables defined for the outline font resource to construct the font's glyphs or to store the font designer's information about creating bitmaps from the font data. Developers of general-purpose applications do not need these tables; consequently, the internal specifications of these tables are not provided in this chapter, although descriptions of their functions are. The needs of platforms other than the Macintosh computer are also not discussed.

Some of the terms used in descriptions of these tables pertain solely to the font designer's creation of the font. The em square is the imaginary area on which the glyphs of the font are first designed. The term units per em describes the resolution of the grid; the greater the number of units per em, the finer the detail of design that the designer can achieve. Apple's TrueType fonts use a resolution of 2048 units per em. The measurement pixels per em describes the relationship of the point size to the em square; the units per em measurements of the font are translated, using this pixels per em measurement, into bitmaps. The Font Manager handles this translation for you.

Similarly, the instruction set is for the use of the font designer only and cannot be used or altered by the Font Manager routines, and so is not included in this chapter. If you want the complete description of all of the tables in the outline font resource, consult the TrueType Font Format Specification.

Each table in the outline font resource is aligned on a longword boundary in memory (long-aligned) and may have been padded when necessary to make it long-aligned. Each table is named with a four character identifier known as its tag name. The only table that does not have a tag name is the font directory table. This table is a guide to the contents of the resource and is mandatory in all outline font resources.

Note
Detailed descriptions of many of the values in the outline font resource tables are found in the TrueType Font Format Specification and are not repeated in this chapter. If you are designing a font editor or similar application that requires detailed knowledge of these tables, please refer to that book.
These are the required tables in the outline font resource:
Tag nameTable
(none)Font directory
'cmap' Character code mapping table
'glyf'Glyph data table
'head'Font header table
'hhea'Horizontal header table
'hmtx'Horizontal metrics table
'loca'Location table
'maxp'Maximum profile table
'name'Font-naming table
'post'PostScript table

Some of the optional tables in the 'sfnt' resource are
TagTable
'cvt 'Control-value table
'fpgm'Font program table
'hdmx'Horizontal device metrics table
'kern'Kerning table
'prep'Preprogram (control value program) table

Font designers can define additional tables for the outline font resource to support other platforms where outline fonts are available or to provide for future expansion of a font. Tag names consisting of all lowercase letters are reserved for use by Apple Computer, Inc.


Subtopics
The Font Directory
The Character-Code Mapping Table
The Control-Value Table
The Font Program Table
The Glyph Data Table
The Horizontal Device Metrics Table
The Font Header Table
The Horizontal Header Table
The Horizontal Metrics Table
The Kerning Table
The Location Table
The Maximum Profile Table
The Font Naming Table
The PostScript Table
The Preprogram Table

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996