XML technologies / CSS / Advanced websites with CSS / Using fonts with CSS / Standard and nonstandard fonts

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

As mentioned at the start of this chapter, always consider whether your font design uses standard or nonstandard fonts.

The term “standard” is itself misleading for fonts. First, no standard or specification dictates which fonts must be installed on a user’s system. Second, no font is guaranteed to exist on every system—not even the widespread Arial and Times New Roman, absent from older Mac OS versions and still unavailable there today.

To control page design as far as possible, we have to provide alternative fonts. Some fonts are common on both systems, and some alternatives look very similar, giving reasonably predictable results. The following table lists the main Windows and Mac OS system fonts meeting these criteria, which we can confidently specify as alternatives in the property font-family.

Table: Comparing Windows and Mac OS fonts.

Windows

Mac OS

System font

Arial, Lucida Sans, Tahoma, Trebuchet MS, Verdana

Arial, Geneva, Helvetica, Helvetica Neue, Lucida Grande, Tahoma, Trebuchet MS, Verdana

sans-serif

Impact

Headline A

sans-serif

Courier New

Courier New, Courier

monospace

Times New Roman, Georgia, Palatino Linotype

Times New Roman, Times, Baskerville

serif

Comic Sans MS

Comic Sans MS, Chalkboard, Marker Felt

cursive

Papyrus

Papyrus

fantasy

If you want Arial on your page, Helvetica is a more important alternative than Geneva, although Geneva more closely resembles Microsoft’s font. As an Adobe PostScript font, Helvetica is much more widespread in older Mac OS versions and on Linux and Unix. Define a sans-serif list in the order Arial, Geneva, Helvetica to use the closest available match.

To address differing system font requirements, Microsoft once offered free TrueType fonts for Windows, Mac OS and Linux. Licensing problems later ended the offer, but a legal loophole means the following fonts remain legally available on many sites:

Many new Mac OS and Windows computers already have these fonts installed. For Linux and Unix, download the collection from sites including Sourceforge. These fonts give a relatively high hit rate in stylesheets, but always provide alternatives in your rules to be safe.

  

  

 

 

 

back to top