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

@font-face and unicode-range

From: Michael Day <mikeday@yeslogic.com>
Date: Sat, 30 May 2009 15:28:25 +1000
Message-ID: <4A20C3F9.7090304@yeslogic.com>
To: John Daggett <jdaggett@mozilla.com>
CC: "www-style@w3.org" <www-style@w3.org>, Håkon Wium Lie <howcome@opera.com>
Hi John,

Recently we have been updating Prince so that @font-face rules are 
handled as described in the latest draft of the CSS3 Fonts module and we 
have also added support for the unicode-range descriptor.

Lots of fun, as this essentially allows the creation of ad hoc fonts 
within CSS, including tricks like making all the lowercase characters 
come from one font and all the uppercase characters come from another :)

We have some questions about the current specification:

  - Should the spec include keywords for common Unicode blocks?

The TrueType OS/2 table includes a UnicodeRange field that describes the 
coverage of several common Unicode blocks, eg. basic_latin, 
latin1_supplement, greek_and_coptic, and so on. Something like this 
could be a useful addition to the spec that would make it easier for 
authors than writing explicit codepoint ranges.

  - Is it worth allowing single character strings to identify codepoints?

For example, 'a' or '\61' could be used as a synonym for U+61. This 
might be easier for people familiar with CSS syntax. It doesn't help 
with the other ranges though, unless 'a'-'z' is also allowed.

  - Is there a need for a "language" descriptor in @font-face rules?

This might be an internal property only needed by vendors and not 
authors, but it seems useful to have a descriptor to distinguish 
particular font faces by language. This could include providing a single 
font to handle traditional and simplified Chinese:

@font-face {
     font-family: MyChineseFont;
     src: url("simpl.ttf");
     language: zh, zh-CN

@font-face {
     font-family: MyChineseFont;
     src: url("trad.ttf");
     language: zh-HK, zh-TW

The only other way to do this at present is using the :lang() selector, 
but that can be difficult to integrate cleanly with other CSS rules and 
uses of the font and font-family properties.

Best regards,


Print XML with Prince!
Received on Saturday, 30 May 2009 05:29:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:49:28 UTC