[csswg-drafts] [css-fonts-4] @font-face unicode-range and first available font

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

== [css-fonts-4] @font-face unicode-range and first available font ==
CSS-Fonts-4 defines first available font as "the first available font that would match any character given font families in the font-family list (or a user agent’s default font if none are available)". As I interpret this, following css and html should use Arial metrics as a source for ex unit:

```
@font-face {
    font-family: Test;
    src: local('Arial');
    font-weight:400;
    unicode-range: U+4??;
}
<div style="font-family:Test; line-height:10ex;">Should be as high as 10ex of Arial</div>

```
Edge is doing what I expect. But Chrome will no use Arial unless there is no unicode-range descriptor or (from my experiments) unicode-range has any value that covers U+0020 space character.

This has effect on performance of @font-face font downloads. Without additional restrictions, we will load extra fonts that would not normally be used because of unicode-range filtering. 

Do I interpret the spec correctly?

Repro page: [https://jsfiddle.net/fdsmzn6j/11/](https://jsfiddle.net/fdsmzn6j/11/)
Definition of first available font: [https://drafts.csswg.org/css-fonts-4/#first-available-font](https://drafts.csswg.org/css-fonts-4/#first-available-font)

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

Received on Tuesday, 29 August 2017 19:12:15 UTC