
16
Fonts
In X, a large number of fonts are provided on the server. Deciding which font to use and then
trying to specify fonts by name can be difficult since there are many different styles and sizes
of fonts. Most fonts are used to render text strings. The images, or glyphs, represent a char-
acter set defined mostly by the language used. However, a font may be built to support
glyphs that have nothing to do with a language. Fonts are stored on the server and are associ-
ated with the display of your workstation. The font ID is stored in the graphics context (GC),
which is used by Xlib functions like XDrawString(). Using fonts to render text is per-
haps the most common application. For example, the Courier font family displays the
classic typewriter or constant-width character set. This text is set in Times-Roman, a propor-
tionally spaced font. Often within a font family, there are different styles, such as bold or
italic, and different point sizes.* For example, lucidasans-bold-14 refers to the luci-
dasans font family, the style is bold, and the point size is 14.
Not all server fonts have a variety of styles and sizes. These special-purpose fonts are gener-
ally specified by name only—there are no corresponding styles or families for these fonts.
When accessing fonts, you typically want to specify a font either by name or by the family,
style, and size or scale of the font. In addition,