Steve Hall wrote:
On Sun, 2006-09-24 at 00:31 +0200, Michael Schaap wrote:
I beg you, please don't hardcode Courier New!

Hear, hear!

Not only is it the worst possible monospaced screen font, it is also
Microsoft specific (in spite of it finding its way onto Tony's Linux
box). (Even Microsoft has seen the light, and changed the default
monospaced font to Consolas in Windows Vista.)

The proper thing to do is to only list "font-family: monospace".
That will use the default monospaced font on any platform, which is
Courier New by default in any case on current Windows browsers. Only
people who have consciously chosen to change their monospaced font
(and people on non-Windows platforms) will not see Courier New.

It's not just the proper way, it's the first thing discussed in the
specification:

  http://www.w3.org/TR/REC-CSS2/fonts.html#font-specification




It is said nowhere in that document that a generic-family should be the only element in a font-face specification. Quite to the contrary, under http://www.w3.org/TR/REC-CSS2/fonts.html#font-family-prop I see the example:

--8<--
BODY { font-family: Baskerville, "Heisi Mincho W3", Symbol, serif }
-->8--

and a little further down:

--8<--
<generic-family>
The following generic families are defined: 'serif', 'sans-serif', 'cursive', 'fantasy', and 'monospace'. Please see the section on generic font families for descriptions of these families. Generic font family names are keywords, and therefore must not be quoted.

Authors are encouraged to offer a generic font family as a last alternative, for improved robustness.

For example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
  <HEAD>
    <TITLE>Font test</TITLE>
    <STYLE type="text/css">
      BODY { font-family: "new century schoolbook", serif }
    </STYLE>
  </HEAD>
  <BODY>
   <H1 style="font-family: 'My own font', fantasy">Test</H1>
    <P>What's up, Doc?
  </BODY>
</HTML>
-->8--

In fact that W3C document mentions "selecting a font by a single string" only to dismiss it as inappropriate because of lack of standardization.


Best regards,
Tony.

Reply via email to