A “font” is a collection of stylized text characters. Each font consists of a typeface with several type sizes.
A “typeface” is the name of the displayed text—Courier, for example, or Roman. The list on the next page shows six of the typefaces available with the Microsoft C font library.
“Type size” measures the screen area occupied by individual characters in units of screen pixels. For example, “Courier 12´9” denotes text of Courier typeface, with each character occupying a screen area of 12 vertical pixels by 9 horizontal pixels.
A font's spacing can be fixed or proportional. “Fixed” means that all characters have the same width in pixels. “Proportional” means the width varies. An i, for example, is thinner than an M.
The Microsoft C font functions use two methods to create fonts. The first technique generates Courier, Helv, and Tms Rmn fonts through a “bit-mapping” (or “raster-mapping”) technique. Bit-mapping defines character images with binary data. Each bit in the map corresponds to a screen pixel. If a bit is 1, its associated pixel is set to the current screen color.
The second method creates the remaining three type styles—Modern, Script, and Roman—as “vector-mapped” fonts. Vector-mapping represents each character in terms of lines and arcs.
Each method has advantages and disadvantages. Bit-mapped characters are more fully formed since the pixel mapping is predetermined. However, they cannot be scaled. Vector-mapped text can be scaled to any size, but the characters tend to lack the solid appearance of the bit-mapped characters.
The following list shows six sample typefaces:
Table 9.6 lists available sizes for each font. Note that the bit-mapped fonts come in preset sizes as measured in pixels. The vector-mapped fonts can be scaled to any size.
Table 9.6 Typefaces and Type Sizes in the C Library
Typeface | Mapping | Size (in Pixels) | Spacing |
Courier | Bit | 10´8, 12´9, 15´12 | Fixed |
Helv | Bit | 10´5, 12´7, 15´8, 18´9, 22´12, 28´16 | Proportional |
Tms Rmn | Bit | 10´5, 12´6, 15´8, 16´9, 20´12, 26´16 | Proportional |
Modern | Vector | Scaled | Proportional |
Script | Vector | Scaled | Proportional |
Roman | Vector | Scaled | Proportional |