Re: [css3-fonts] low-level font features

The new format looks pretty good to me. John, since feature tags beginning with numbers wouldn't be allowed in this format, could we get around that by requiring that such tags be passed as strings instead (should that ever be necessary)?

I don't much care for the "off" syntax (e.g. 'cpsp(0)'). It just strikes me as less intuitive than in needs to be. Are there alternatives? What about, for example,

  font-feature-settings: -cpsp;

Perhaps that conflicts with CSS conventions, but to me it says "turn this feature off" more than the current proposal.

-Christopher


On Jun 21, 2010, at 7:48 PM, John Daggett wrote:

> I originally posted this to www-style since it's related to CSS syntax but 
> I thought I would repost this here to increase the feedback.
> 
> 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 Wednesday, 23 June 2010 01:14:04 UTC