RE: FW: Font-family specification

Chris Wilson ([email protected])
Wed, 31 Jan 1996 09:10:43 -0800


I would highly recommend doing both - changing separators from whitespace to
commas, and recommending the use of quotes to wrap font family names. The
reason for this is evident when you consider an example with more than one
font-family:
font: 12pt/14pt "New Century Schoolbook" "Serif" bold
Without explicitly doing compares for all weight strings, plus numeric
values (font-weight can be a number), plus all font-style strings, you can't
tell if the last word is a font family name, a font weight, or a font style.
(Before you say, "but quotes could be required," think: what are you going
to do if someone says, "Roman" without quotes? Really ignore it
completely?) To detect whether it is a weight or style (which you need to
do anyway, since weight is optional), you need only compare it to the four
font styles (normal, italic, oblique and small-caps). The above example
becomes less ambiguous when you say:
font: 12pt/14pt "New Century Schoolbook", "Serif" bold
Now, any strings not preceded by a comma are ignored as font families.

-Chris
Chris Wilson
[email protected]

----------
From: [email protected][SMTP:[email protected]]
Sent: Wednesday, January 31, 1996 8:41 AM
To: [email protected]
Subject: Re: FW: Font-family specification

Thanks to Chris and others for pointing out potential problems with
the current font specification in CSS1 [1]. There have been 2 proposed
solutions:

- introducing commas to separate font families, e.g.:

font-family: new century schoolbook, serif;

- quoting font familiy names with spaces in them, e.g.:

font-family: "new century schoolbook" serif;

Both these would solve the problem for the 'font-family' property, but
only the latter would work in the compound 'font' property. E.g., for the
hypothetical font family 'best in bold':

font: 12pt/14pt best in bold

Here, it would be ambigous if 'bold' is a part of the font family name
or a value to the 'font-weight' parameter. Unless better solutions are
suggested, I'll add quoting of font family names to the next version
of the specification.

[1] http://www.w3.org/pub/WWW/TR/WD-css1-951222.html

Regards,

-h&kon

Hakon W Lie, W3C/INRIA, Sophia-Antipolis, France
http://www.w3.org/People/howcome [email protected]