[css3-fonts] low-level font features

After some discussion with others, I'm thinking about changing the
syntax of the 'font-feature-settings' property.  The current CSS3 Fonts
Editor's Draft includes the ability to directly specify low-level font
features using this property.

  http://dev.w3.org/csswg/css3-fonts/#font-feature-settings-prop

The property syntax is currently defined as: 

  font-feature-settings:  normal | <string> 

where <string> for OpenType fonts is a comma-separated list of
<feature-name>=<number> paired values. Feature names for OpenType are
listed here:

  http://www.microsoft.com/typography/otspec/featurelist.htm

Other font-variant-xxx properties already provide access to many
commonly used features. This property allows access to less commonly
used features that don't fully justify a separate property.

Defining the syntax as a string potentially allows other new font formats
to be supported in the future.  But it is slightly odd to be defining it as
a string but then specifying a syntax for OpenType fonts only.

To simplify this a bit, I'm thinking of revising this to:

  font-feature-settings:  <featuretaglist> | <string> 
  <featuretaglist> = ident[( <integer> )]? [, ident[( <integer> )]?]*
  
For OpenType fonts, <featuretaglist> must be used while for other font
formats either <featuretaglist> or <string> can be used, without no
defined format for non-OpenType fonts.  The <integer> value must be 0 or
greater; if omitted the value of 1 is assumed.  Feature tags that don't
exist are simply ignored.

An example using the current syntax:

  /* Turn capital spacing on, turn proportional kana off */
  font-feature-settings: "cpsp=1, pkna=0";
  
Using the proposed revised syntax:

  font-feature-settings: cpsp, pkna(0);

For OpenType fonts, the example below would be valid syntax but would be
effectively ignored since neither of the tags are valid OpenType feature
tags:

  font-feature-settings: this(5), that(0);
 
This syntax feels more CSS-like and eliminates the use of quoted strings
for OpenType fonts.  I don't know if it can completely express feature
settings for other font formats.  The ability to specify a <string>
allows some room for defining a way of specifying feature settings for
future font formats.

It would be very helpful to hear whether better support for AAT font
features should also be defined here (especially folks from Apple) or
if there are other font formats that should also be considered.

Regards,

John Daggett

Received on Sunday, 20 June 2010 04:56:46 UTC