W3C home > Mailing lists > Public > www-style@w3.org > March 2012

Re: [css3-font] unquoted font family names with whitespace

From: Gérard Talbot <www-style@gtalbot.org>
Date: Sat, 17 Mar 2012 19:42:59 -0400
Message-ID: <ed13fc8d5fe3efd756aa140f4636e6e0.squirrel@ed-sh-cp3.entirelydigital.com>
To: "woschd" <moz@jeka.info>
Cc: www-style@w3.org

Le Sam 17 mars 2012 18:28, woschd a écrit :
> John Daggett <jdaggett@mozilla.com> hodd gsachd:
>> In real world use, this is rarely a problem.  Font family names may
>> have spaces but typically don't start with numbers or use punctuation
>> characters.  Yes, I'm sure there are exceptions out there but they
>> generally aren't used on the web or in interchange situations (e.g.
>> email).
> I had a real problem with unqouted "Courier 10 Pitch" recently.
> A font stack like
> "Courier 10 Pitch", "Nimbus Mono L", FreeMono, "Courier New", Courier,
> monospace;
> is needed to avoid fallback from "Courier New" to something like
> "DejaVu Sans Mono" on many Linux systems (while "Courier 10 Pitch" is
> the better font anyway).
> j.j.

div {font-family: "Courier 10 Pitch";}
is valid and correct.

div {font-family: Courier 10 Pitch;}
is not valid and not correct as one of the identifiers starts with a
digit. And you can not do this unless quoting the font-family or by
escaping the 1.

I just tried to CSS validate
div {font-family: Courier 10 Pitch;}
and the CSS validator only reported a warning when it should be an error.

This is most likely the same bug as the Hawaii 5-0 font-family bug I

Bug 12428 - Unquoted font-family name Hawaii 5-0 is reported valid by
validator and not parsed+reported as invalid

j.j., if you try or have tried

"Courier 10 Pitch", Nimbus Mono L, FreeMono, Courier New, Courier, monospace;

then it should be parsed accordingly and without any problem.

regards, Gérard
CSS 2.1 Test suite RC6, March 23rd 2011

Contributions to CSS 2.1 test suite

Web authors' contributions to CSS 2.1 test suite
Received on Saturday, 17 March 2012 23:43:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:13 UTC