[csswg-drafts] [css-fonts-4] [varfont] Problem setting up a "4-style family" with variable fonts

Lorp has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-fonts-4] [varfont] Problem setting up a "4-style family" with variable fonts ==
I’ve been trying to set up a typical family of 4 webfonts, but using variable fonts. Maybe I’m missing something, but there seems to be no easy way to specify the instances you want to be used when content calls for bold, italic and bold-italic members of the font family.

With normal non-variable fonts, I’d set up 4 separate @font-face requests, each with its own src property and each with its font-weight and font-style setting (when they were not default). So for the regular and bold styles I would use:

~~~~
@font-face {
        font-family: Gingham;
        src: url("Gingham-Regular.ttf");
    }

@font-face {
        font-family: Gingham;
        src: url("Gingham-Bold.ttf");
        font-weight: bold;
    }
~~~~

— and we’d get 2 more members of the family for the italics, each with updated src URL and font-style:italic property.

For variable, I would like to do something very similar, for example (note identical src URLs):

~~~~
@font-face {
        font-family: Gingham;
        src: url("Gingham-Variable.ttf");
    }

@font-face {
        font-family: Gingham;
        src: url("Gingham-Variable.ttf");
        font-weight: bold;
    }
~~~~

However this assumes I want to use the instances at font-weight 400 for the regular and font-weight 700 for the bold.

Let’s say I want my regular at font-weight 343 and my bold at font-weight 844. Of course I can set up CSS rule that, *for particular selectors*, obtains those instances. Yet they won’t be activated by any content that explicitly or implicitly calls for 'font-weight:bold'.

What seems to be desirable, because of the vast amount of content that calls for it, is to decouple font-weight:normal from font-weight:400 and to decouple font-weight:bold from font-weight:700. So, is there a technique for this that I haven’t thought of?

https://drafts.csswg.org/css-fonts-4/#font-weight-prop

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1289 using your GitHub account

Received on Monday, 24 April 2017 20:11:01 UTC