W3C home > Mailing lists > Public > www-style@w3.org > May 2004

Re: Question on parsing of "font" property

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 19 May 2004 14:54:35 -0700
Message-ID: <005501c43deb$e0d74630$1902000a@AFedoniouk>
To: "Boris Zbarsky" <bzbarsky@MIT.EDU>
Cc: <www-style@w3.org>

> So?  What do font names have to do with nmtoken>

Let's take a look here:

declaration
  : property ':' S* expr prio?
  | /* empty */
  ;
expr
  : term [ operator term ]*
  ;
term
  : unary_operator?
    [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
      TIME S* | FREQ S* | function ]
  | STRING S* | IDENT S* | URI S* | hexcolor
  ;

operator
  : '/' S* | COMMA S* | /* empty */
  ;

following this we are getting rule for a non quouted font names:

font-name: IDENT S* [, IDENT S* ]* 

where IDENT is 

IDENT {nmstart}{nmchar}*

nmstart		[_a-z]|{nonascii}|{escape}
nmchar		[_a-zA-Z0-9-]|{nonascii}|{escape}

So each component of  non quoted font name MUST be an IDENT
So e.g. font name @batang MUST be escaped

PS: sorry I used 'nmtoken' by mistake.
But in fact IDENT is even more strict.


Andrew Fedoniouk.
http://terrainformatica.com
Received on Wednesday, 19 May 2004 17:54:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:30 GMT