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
reported:

Bug 12428 - Unquoted font-family name Hawaii 5-0 is reported valid by
validator and not parsed+reported as invalid
https://www.w3.org/Bugs/Public/show_bug.cgi?id=12428

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
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html
Received on Saturday, 17 March 2012 23:43:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:48:52 GMT