- From: Thomas Phinney <tphinney@cal.berkeley.edu>
- Date: Thu, 16 Sep 2010 22:52:08 -0400
- To: John Daggett <jdaggett@mozilla.com>
- Cc: www-style <www-style@w3.org>, www-font <www-font@w3.org>
- Message-ID: <AANLkTimoV9qwE7w2e777J95mEzjcDY5JUNFzMADg0Vd6@mail.gmail.com>
The utility of maintaining weird feature selections during fallback is somewhat dependent on what the operational definition of font family is. If it remains either Windows GDI families or even WWS families, there will be plenty of situations where typographic families transcend font-family boundaries (though more so in the former case). Regards, T Notwithstanding that, I don't have a major objection to this. On Thu, Sep 16, 2010 at 8:41 PM, John Daggett <jdaggett@mozilla.com> wrote: > > During the discussion of font feature support at the last CSS meeting, > there was a lot of concern expressed about the use of numeric > selectors to choose specific glyph variants. Using an example from > the spec: > > h2 { font-variant-alternates: styleset(3,5); } > h2:first-letter { font-variant-alternates: swash(2); } > > These values are very font specific, if fallback occurs > unintended glyph selection can occur. These values also poorly > document their intended purpose. > > At the meeting Chris suggested using another @-rule to define > explicit value names for specific families, so today fantasai > and I hashed out a syntax: > > @font-feature-values <font-family> { > <font-variant-value> : <value-list> [, <value-list>]; > <font-variant-value> : <value-list> [, <value-list>]; > . > . > } > > where: > > <font-family> :== font family name, quoted or unquoted > <font-variant-value> :== the name of one of the font-specific font-variant > values (e.g. swash, styleset, annotation) > <value-list> :== <value-name> <integer>+ > <value-name> :== a user-defined identifier used to describe the numeric > value > <integer> := an integer value greater than 0 > > Multiple integers would only be permitted for font-variant values that > permitted multiple values (e.g. styleset, character-variant). Other > font-variant values would only permit a single value. > > @font-feature-values My Lovely Font { > swash: swishy 1, flowing 2; > stylistic: long-k 2; > styleset: alt-g 1, alt-m 3, curly-quotes 5, code 4 7 9; > } > > body { font-family: My Lovely Font, GreatJapaneseFont, sans-serif; } > h2 { font-variant-alternates: styleset(alt-m, curly-quotes); } > h2:first-letter { font-variant-alternates: swash(flowing); } > > code { font-variant-alternates: styleset(code); } > p { font-family: Another Lovely Font; } > > The style rules for h2 here are the same as in the original example > using numeric values at the beginning of this message. If the headings > contained Japanese, none of the font-variant settings would apply > since the values aren't defined for GreatJapaneseFont. > > This does add more syntax but it nicely solves the fallback problem > and leads to stylesheets that more clearly indicate the variants being > used in a style rule. > > -- What will happen when I take over — http://xkcd.com/792
Received on Friday, 17 September 2010 02:52:42 UTC