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

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

From: Glenn Adams <glenn@skynav.com>
Date: Thu, 15 Mar 2012 00:48:11 -0600
Message-ID: <CACQ=j+fMey3HJwdBi2mVqy_GRom+FwK8TgUGW3aDFtDjLx5=gA@mail.gmail.com>
To: Simon Pieters <simonp@opera.com>
Cc: Gérard Talbot <www-style@gtalbot.org>, www-style mailing list <www-style@w3.org>
it would be a mistake to call out specific punctuation, since most fonts
permit font names to be arbitrary Unicode strings;

if one were to rewrite the rule, then it should be written something like:

"If the font family name contains a character not included in a <CSS token
- substitute something more formal here>, then it must be quoted."

2012/3/15 Simon Pieters <simonp@opera.com>

> On Wed, 14 Mar 2012 19:26:13 +0100, Gérard Talbot <www-style@gtalbot.org>
> wrote:
>
>
>> Le Mer 14 mars 2012 2:52, Simon Pieters a écrit :
>>
>> Simon,
>>
>> I have modified the subject line as this is CSS21 material.
>>
>>
>  Unescaped unquoted font family names that start with a digit or contain
>>> punctuation characters other than hyphen will break *even if there is no
>>> whitespace*.
>>>
>>
>> "
>> For example, the following declarations are invalid:
>>
>> (...)
>> font-family: Hawaii 5-0, sans-serif;
>> "
>> http://www.w3.org/TR/CSS21/**fonts.html#font-family-prop<http://www.w3.org/TR/CSS21/fonts.html#font-family-prop>
>>
>>
>> The font-family name Hawaii 5-0 contains 1 white space and 1 hyphen and it
>> is invalid.
>>
>
> But it's not invalid because of the whitespace or the hyphen. It's invalid
> because one of the tokens start with a number.
>
>
>
>>  Suggested wording:
>>>
>>> To avoid mistakes in escaping, it is recommended to quote font family
>>> names that contain words that start with digits or contains punctuation
>>> characters other than hyphens:
>>>
>>
>>
>> If an unescaped unquoted font-family name starts with an hyphen followed
>> by a digit, then it will be invalid syntax. If it starts with 2 hyphens,
>> it should be invalid.
>>
>
> You're right, it could be more accurate.
>
>
>
>>
>>> body { font-family: "Amalgamate O (outlined)", serif }
>>>
>>> <BODY STYLE="font-family: '21st Century', fantasy">
>>>
>>> --
>>> Simon Pieters
>>> Opera Software
>>>
>>
>> I think the punctuation characters themselves should be listed, otherwise
>> a few of them, the most common ones: !, #, /, -, @, ?, $, etc
>>
>
> Yeah, that's fine. The apostrophe is a character I've seen in font names
> which may be useful to call out as well.
>
>  Gérard
>>
>
>
> --
> Simon Pieters
> Opera Software
>
>
Received on Thursday, 15 March 2012 06:49:01 GMT

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