Fonts

Truth

When you specify a font in your HTML or CSS, you are, in effect, making a suggestion to the browser.  The browser will attempt to follow your suggestion (unless the user has made an overriding suggestion) but it is constrained by which fonts are actually installed on the user's system. 

Consequences

The font that actually appears may differ from your suggestion.  If you specified a list of possible choices, the font that appears may be any of those you listed, one listed in a user's style sheet, or one of several generic fonts determined by the browser, based on what it found lying around.

Recommendations

Use commonly-available fonts most of the time (if you can find out which ones are common).  When you use unusual fonts, include some suitable, though common, ones later in the list, to increase your odds of getting something approaching what you had in mind.  Don't be surprised when you see different fonts while viewing your page on a friend's machine (or a different browser on your own).  Unless the font is completely unreadable, the content is much more important than the font it appears in.

Tips

  1. Specify font information in CSS, not the deprecated <font> element.
  2. Always specify one of the five generic fonts (serif, sans-serif, cursive, fantasy, or monospace) last in the list of suggested fonts.  If none of your other suggestions can be found, the generic font will be used, which should at least get you in the ballpark.  [In the preceeding list, if your browser supports CSS, the fonts displayed are the generics assigned by your browser today.]  Otherwise, the browser will use its own default, which is often a poor choice.
  3. Don't use too many fonts on one page or within a site.  The more fonts you use, the greater the probability that someone will see an ugly combination, since the browser selects each font without regard to the others.
  4. In your page text, do not refer to a font you are using by name or by visible characteristics, as the user may be seeing something altogether different.  If your page actually talks about the appearance of a font, you will need to use an image of the font (but see the Text in images page).
  5. If someone starts to tell you about downloadable fonts, ask them about cross-browser compatibility.  They will quietly slink away.

Last revised 31 Jan 2006