W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2018

Re: [csswg-drafts] [css-fonts-3] @font-face font-variant cannot easily be reverted to default

From: Mike Bremford via GitHub <sysbot+gh@w3.org>
Date: Mon, 05 Feb 2018 17:24:44 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-363156402-1517851483-sysbot+gh@w3.org>
In fact you can turn off swashes, stylesets etc with no change to the current spec by setting the value to 0
```
@font-feature-value { @swash { none : 0 } }
.noswash { font-variant-alternates: swash(none); }
```

It might be nice to assign "none" a special value without needing a font-feature-value, but it's not necessary. However the problem remains with historical-forms, tabular-nums etc., and I agree with your reasoning behind for a proposed "no-" options for those.

But I'm not sure I follow your point with `font-variant-alternates: none` - you quoted the definition of "normal": did you mean "normal" instead of "none"? Because, if I've understood the specification correctly, normal doesn't turn **off** font-variant-alternates: it just *doesn't turn them on* (a distinction I missed on the first pass of our implementation).

Both interpretations are effectively identical _except_ when one of the rules is defined in the @font-face rule. So for example:
```
@font-face {
    font-family: myfont;
    font-variant: historical-forms;  /* turn on "hist" for all instances of "myfont" */
}
body {
    font-family: myfont;
    font-variant-alternates: normal;  /* don't enable any new features. The features set in @font-face still apply as described in the font-feature resolution rules */
}
```

Or were you proposing a new "none" keyword for font-variant-alternates and friends? The problem with this is that it slightly changes existing behaviour of the shortcut property `font-variant: none`. Current situation:
```
@font-face {
    font-family: myfont;
    font-variant: historical-forms;
}
body {
    font-variant: none;
    /* implies:
     * font-variant-ligatures: none;      explicitly turns off common-ligatures;
     * font-variant-alternates: normal;   don't enable any new features; historical-forms still applies as in above example
    */
}
````
Proposed situation:
```
@font-face {
    font-family: myfont;
    font-variant: historical-forms;
}
body {
    font-variant: none;
    /* implies:
     * font-variant-ligatures: none;    explicitly turns off common-ligatures;
     * font-variant-alternates: none;   explicitly turns off historical-forms
    */
}
````

I don't know if this actually matters or not, but I'm slightly more wary of changing existing behaviour of an existing keyword than I would be about adding a new keyword.


Finally, I've created a pull request (hopefully; still getting my head around git) for two new testcases for this behaviour, as I could find none. They build on your tests Chris, I've put an explanation of the logic in the comments which hopefully will help make sense of them (or alternatively, highlight where I've misunderstood the specification). Pull request is https://github.com/w3c/web-platform-tests/pull/9397

-- 
GitHub Notification of comment by faceless2
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2265#issuecomment-363156402 using your GitHub account
Received on Monday, 5 February 2018 17:24:46 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:24 UTC