Re: [csswg-drafts] [css-fonts] font property descriptors for variable fonts

It would be unfortunate is descriptor defaults prevented variable fonts from being used in a simple and natural way without adding descriptors. Unfortunately the initial value for the `font-weight` descriptor has always been `normal` i.e. 400, so we can't change the initial value.

Other ways to address this:

```
@font-face {
    font-family: MyVariableFont;
    src: url(fonts/MyVar.ttf);
    font-weight: 1 999;
}
```
allows any defined weight to be used (might have to be used with font-synthesis to prevent synthetic weights outside the range of weights supported by the variable font). Having to always specify the 1 999 is a pain though.

Another option, assuming the designer has examined the font and knows the supported range (or indeed, the range they wish to have used, which may not be the same):

```
@font-face {
    font-family: MyVariableFont;
    src: url(fonts/MyVar.ttf);
    font-weight: 65 490;
}
```

and lastly, adding an `auto` value which (for non-variable fonts) is the same as the initial value, and (for variable fonts) is the same as the range supported by the relevant axis for that font. So:

```
@font-face {
    font-family: MyVariableFont;
    src: url(fonts/MyVar.ttf);
    font-weight: auto;
}
```


-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2485#issuecomment-377337805 using your GitHub account

Received on Thursday, 29 March 2018 18:57:57 UTC