alternate font properties

David Perrell writes:

 > A while ago, Todd Fahrner noted a need for alternate font size and
 > styling properties in addition to the font-family. Having just had
 > occasion to wish for the same, I wonder why the current spec couldn't
 > be easily enhanced with a minor expansion of allowed values for the
 > 'font' property.

Syntactically it's a minor change, but conceptually it's quite major.
Read on.

 > Currently, 'font' is a "shorthand property for setting 'font-style'
 > 'font-variant' 'font-weight' 'font-size', 'line-height' and
 > 'font-family' at the same place in the style sheet." The examples show
 > multiple font-families comma-delimited. But the commas could delimit
 > multiple complete font declarations without altering current usage.
 > 
 > Examples:
 > 
 >   P { font: normal 10pt/12pt Verdana, 11pt Arial, 11pt sans-serif } 
 >   H2 { font: normal 14pt/14pt "Friz Quadrata", bold Palatino, serif }

The 'font' property is a "shorthand" property to save keystrokes and
bandwidth. It's pure syntactic sugar; in CSS1, a rule involving a
shorthand property can always be rewritten using using the individual
properties. If we make the proposed change, this will no longer be the
case.

Take your first example. You have three font families (Verdana,
Arial, sans-serif). This can be represented in the 'font-family'
property which can take a comma-separated list of values.

Then you have three font sizes (10pt, 11pt, 11pt). Since 'font-size'
only takes one value, the three font sizes cannot be represented.
Bummer.

One may argue that 'font-size' (and the other propeties that 'font' is
a shorthand for) should be extended to take a comma-separated list of
values as well. This could potentially be done in whatever comes after
CSS1, but the result would not necessarily look pretty:

  font-family: Verdana, Arial, sans-serif;
  font-size: 10pt, 11pt, 11pt;

Correlating the various values in the lists is a messy job.

Another solution would be to make 'font' into something other than
just a shorthand property. But overwhelming evidence will need to be
presented..

The better solution is probably to look at what [1] can offer..

[1] http://www12.w3.org/TR/WD-font

-h&kon

H   å   k   o   n      W   i   u   m       L   i   e
howcome@w3.org   W o r l d   Wide  W e b  Consortium
inria §°þ#¡ª FRANCE http://www.w3.org/people/howcome

Received on Monday, 28 July 1997 19:06:18 UTC