Re: [css3-fonts] new editor's draft posted

Sylvain Galineau wrote:

> [Liam R E Quin:]
> > I am not convinced by making all of the hard-coded sub-properties.
> > The stability of the Adobe opentype feature registry isn't clear, and I
> > think having "low-level" and "high-level" access to the same features
> > confusing - you can turn ligatures on with one property and off again with
> > another, they are not orthogonal.  In addition, as new features are added
> > from time to time, or for other font formats, CSS would need to be updated.
> 
> I was starting to wonder about that. If a font-variant-* property and the
> font-feature-settings property contradict each other, what happens ?

While this is certainly a problem, the goal here is to cover most important
OpenType features by defining appropriate font-variant values for them. For
those excluded from the defined set, authors can use the feature tags
directly but this will only be necessary in special situations.

The specific rules for resolving the feature settings for a given element
are defined in section 7:

  http://dev.w3.org/csswg/css3-fonts/#rendering-considerations

Basically, low-level settings take precedence over high-level settings and
settings specified in properties take precedence over those specified
within @font-face rules.

Example (see OpenType feature registry [1] for exact tag definitions):

@font-feature-values {
  @styleset stacked-a 3;
}

@font-face {
  font-family: Jupiter Gothic;
  font-variant: styleset(stacked-a);      /* ss03=1 */
  font-feature-settings: "ital", "lnum";  /* ital=1, lnum=1 */
}

body {
  font-family: Jupiter Gothic, sans-serif;
  font-variant-numeric: tabular-nums oldstyle-nums;  /* tnum=1, onum=1 */
  font-feature-settings: "hkna", "ital" off;         /* hkna=1, ital=0 */
}

Using the rules defined in section 7, when Jupiter Sans is used for body text,
the combination of font-variant and font-feature-settings will resolve to:

  ss03=1, lnum=1, tnum=1, onum=1, hkna=1, ital=0

The setting for 'ital' in the property overrides the default specified in
the @font-face rule. Since some properties are mutually exclusive, the
OpenType engine will resolve "lining figures on" (i.e. lnum=1), followed by
"old-style figures on" (i.e. onum=1) to be "old-style figures on".

This is an intentionally complicated example and should be treated as an
edge case rather than the common use case.  The point is simply that the
rules for handling complicated cases like this are defined enough to get
good interoperability.  The design goal for specifying font feature
properties is to make the use of font-feature-settings relatively rare but
still possible.

Cheers,

John Daggett

[1] http://www.microsoft.com/typography/otspec/featurelist.htm

Received on Monday, 14 March 2011 03:16:41 UTC