Chapter 5. Fonts

As the authors of the CSS specification clearly recognized, font selection would be a popular (and crucial) feature. After all, how many pages are littered with dozens, or even hundreds, of <FONT FACE="..."> tags? In fact, the beginning of the “Font Properties” section of the specification begins with the sentence, “Setting font properties will be among the most common uses of style sheets.”

Despite that importance, however, there currently isn’t a way to ensure consistent font use on the Web because there isn’t a uniform way of describing fonts and variants of fonts. For example, the fonts Times, Times New Roman, and TimesNR may be similar or even the same, but how would a user agent know that? An author might specify “TimesNR” in a document, but what happens when a user views the document without that particular font installed? Even if Times New Roman is installed, the user agent has no way to know that the two are effectively interchangeable. And if you’re hoping to force a certain font on a reader, forget it.

Although CSS2 defined facilities for downloadable fonts, they weren’t well implemented by web browsers, and a reader could always refuse to download fonts for performance reasons. CSS does not provide ultimate control over fonts any more than a word processor; when someone else loads a Microsoft Office document you have created, its display will depend on that person’s installed fonts. If they don’t have the same fonts you do, then the document will look ...

Get Cascading Style Sheets: The Definitive Guide, Second Edition 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.