14.9. Fonts

Fonts are stylized collections of letters and symbols. Different fonts can be used to convey different information; specialized fonts can be used to provide special characters or symbols. Although fonts can be quite different from each other, they share the same basic characteristics, as shown in Figure 14-12.

Figure 14-12. Figure 14-12

Fonts are mapped according to a system similar to ruled paper. The line that the characters or symbols sit on is called the baseline. The distance between the baseline and the top of the highest characters (usually capital letters and lowercase letters such as l, f, or t) is known as the ascension. The distance between the baseline and the lowest point of characters that dip below it (such as p, g, or q) is known as the descension.

Vertical font measurements, such as line spacing or leading, are typically measured between the baselines of text, at least as far as CSS is concerned.

Just as CSS offers many properties to control lines and paragraphs, it also offers many properties to control the font(s) of the text in your documents.

14.9.1. Font Selection

CSS supports five different font family types. These general types can be used to apprise a user agent of the type of font face it should use. Those five families are as follows:

  • Serif—Serif fonts have little ornamentation on each glyph (character—includes letters, numbers, and symbols). ...

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.