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 / About Fonts


Characters, Character Codes, and Glyphs

The smallest element in any character set is a character, which is a symbol that represents the concept of, for example, a lowercase "b", the number "2", or the arithmetic operator "+". You do not ever see a character on a display device. What you actually see on a display device is a glyph, the visual representation of the character. One glyph can represent one character, such as a lowercase "b"; more than one character, such as the "\xDE" ligature, which is a single glyph that could represent two characters; or a nonprinting character, such as the space character.

When you want to print or display text, you generally refer to characters rather than glyphs. The Font Manager identifies an individual character by a character code and provides the glyph for that character to QuickDraw. Character codes for most character sets are single byte values between $00 and $FF; however, the character codes for some large character sets, such as the Japanese character set, are two bytes long. A font designer must supply a missing-character glyph--usually an empty rectangle (

)--for characters that are not included in the font. QuickDraw displays this glyph whenever the user presses a key for a character that is not in the font. The Font Manager does not use the missing-character glyph for nonprinting characters, such as the space character, that are included in the 'FONT', bitmapped font, and outline font resources.

Although most fonts assign the same glyphs to character code values $00 to $7F, there are differences in which glyphs are assigned to the remaining character codes. For example, the glyph assigned to byte value $F0 (

) in the Apple Standard Roman character set is not typically included in a font defined for a non-Apple software system. And different regions of the world require different glyphs for their typography, which makes it impossible for any one standard to be complete.

The character-encoding scheme was developed to manage the assignment of different glyphs to character codes in different fonts. It names each character and then maps that name into a character code in each font. PostScript fonts that use an encoding scheme that differs from the standard Apple encoding scheme can specify their glyph assignments in the encoding table of the font family resource, which is described in the section "The Style-Mapping Table," beginning on page 4-93. This table contains a collection of assignments of glyph names to character codes. For example, the PostScript name of the character "ñ" is "ntilde"; a font designer can specify in the encoding table that this character is assigned to character code $B9.

The Font Manager uses two types of glyphs: bitmapped glyphs and glyphs from outline fonts. A bitmapped glyph is a bitmap--a collection of bits arranged in rows and columns--designed at a fixed point size for a particular display device, such as a monitor or a printer. For example, after deciding that a glyph for a screen font should be so many pixels tall and so many pixels wide, a font designer carefully chooses the individual pixels that constitute the bitmapped glyph. A pixel is the smallest dot the screen can display. The font stores the bitmapped glyph as a picture for the display device.

A glyph from an outline font is a model of how a glyph should look. A font designer uses lines and curves rather than pixels to draw the glyph. The outline, a mathematical description of a glyph from an outline font, has no designated point size or display device characteristic (such as the size of a pixel) attached to it. The Font Manager uses the outline as a pattern to create bitmaps at any size for any display device.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996