Re: arial isn't allowed?

On Sun, 14 Aug 2005, ReVaDeBe wrote:

> when I try to validate my CSS-file, the validator says " font-family : arial, sans-serif;" isn't good CSS.
> "It contains too many (unknown) values".
> But when I delete 'arial, ' it is OK.
> So the 'unknown value' is arial, but this is a standard font...

Since a very similar problem was just reported by Michal Dlouhý on this 
list, with a description of how to reproduce the problem, it seems that 
the URL I asked for in my previous reply isn't needed in this case.

Apparently you, too, have encountered the "validator's" new (?) feature of 
checking font names against some list of names _when in "CSS Version 3" 
mode. Well, in some cases at least. If you have just
   body { font-family: arial; }
then the "validator" issues a (questionable) warning
   You are encouraged to offer a generic family as a last alternative
but if you use
   body { font-family: arial, sans-serif; }
then you get an _error_ message as quoted above!

If you capitalize the font name, writing Arial instead of arial, the 
problem disappears, apparently because Arial is in the list that the 
"validator" uses and arial is not. In principle, font names are case 
sensitive, and they are usually capitalized. Therefore you could actually 
fix arial to Arial, but this doesn't make the "validator's" behavior 
correct.

(It might be useful if a CSS checker checked font names against some list 
of commonly used fonts and issued a _warning_ if a name appearing in a 
style sheet differs so little from a name in the list that it is probably 
a misspelled font name, such as arial or Ariel. But reporting all font 
names outside the list as errors is a gross error.)

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Monday, 15 August 2005 09:01:49 UTC