Character Code/Glyph Mapping Requirements and Recommendations
The following is a list of required characteristics for glyphs and their corresponding character codes in Apple TrueType fonts.
- The first glyph (glyph index 0) must be the MISSING CHARACTER GLYPH. This glyph must have a visible appearance and non-zero advance width.
- The second glyph (glyph index 1) must be the NULL glyph. This glyph must have no contours and zero advance width.
- All characters in the appropriate Macintosh character set(s) must be present in fonts to be used with proper Macintosh applications. Certain specified characters, however, are mapped to the MISSING CHARACTER GLYPH as stated below. This is not true for Unicode; there is no requirement for Unicode coverage except that it should at least be the complete set of Unicode equivalents of characters in at least one Macintosh character set.
- If a font has multiple cmaps, then corresponding characters in the respective character sets should be mapped to the same glyphs.
- The following character codes must be mapped to the first glyph (glyph index 0, MISSING CHARACTER GLYPH):
- 0x0001 START OF HEADING
- 0x0002 START OF TEXT
- 0x0003 END OF TEXT
- 0x0004 END OF TRANSMISSION
- 0x0005 ENQUIRY
- 0x0006 ACKNOWLEDGE
- 0x0007 BELL
- 0x000A LINE FEED
- 0x000B VERTICAL TABULATION
- 0x000C FORM FEED
- 0x000E SHIFT OUT
- 0x000F SHIFT IN
- 0x0010 DATA LINK ESCAPE
- 0x0011 DEVICE CONTROL 1 (X-On)
- 0x0012 DEVICE CONTROL 2
- 0x0013 DEVICE CONTROL 3 (X-Off)
- 0x0014 DEVICE CONTROL 4
- 0x0015 NEGATIVE ACKNOWLEDGE
- 0x0016 SYNCHRONOUS IDLE
- 0x0017 END OF TRANSMISSION BLOCK
- 0x0018 CANCEL
- 0x0019 END OF MEDIUM
- 0x001A SUBSTITUTE
- 0x001B ESCAPE
- 0x001C FILE SEPARATOR
- 0x001E RECORD SEPARATOR
- 0x001F UNIT SEPARATOR
- 0x007F DELETE
- The following characters must map to the second glyph (glyph index 1, the NULL glyph):
- 0x0000 NULL
- 0x0008 BACKSPACE
- 0x000D CARRIAGE RETURN (in a right-to-left font)
- 0x001D GROUP SEPARATOR
- Each of the following characters must map to a glyph with no contours and positive advance width:
- 0x0009 HORIZONTAL TABULATION
- 0x000D CARRIAGE RETURN (in a left-to-right font)
- 0x0020 SPACE
- 0x00A0 NO-BREAK SPACE
- The following groups of characters must have the same width
- 0x0009 (HORIZONTAL TABULATION) and 0x0020 (SPACE)
The following list of recommendations are for the glyphs mapped to the character codes stated. They are intended to aid in line layout
- Lining numbers should be monospaced. These include 0x0030 through 0x0039 (digits zero through nine) and 0x00CA (Unicode U+2007) FIGURE SPACE. Old-style figures need not be monospaced.
- In cursive fonts, glyphs should overlap to allow glyphs to join together in device-independent text. a 5% overlap is recommended.
- White space should be evenly distributed between the left- and right-side bearings of glyphs. Extra space should be placed on the right if grid-fitting results in an odd number of pixels.