E47B [css-fonts-4] @font-family src: should accept a specifier which lists font requirements · Issue #633 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-fonts-4] @font-family src: should accept a specifier which lists font requirements #633

@litherum

Description

@litherum

When discussing the format() specifier with regards to font variations, we came across diverging behavior between different browsers.

There are two possible mechanisms (that I know of) for fallback:

@font-face {
    ...
    src: url("file-novariations.otf") format("opentype");
    src: url("file-variations.otf") format("opentype", "variations");
}

and

@font-face {
    ...
    src: url("file-variations.otf") format("opentype", "variations"), url("file-novariations.otf") format("opentype");
}

Currently, with either of the above examples, Edge and Firefox would download the variation font even when though those browsers don't (currently) understand variations.

The spec states:

The format hint contains a comma-separated list of format strings that denote well-known font formats. Conformant user agents must skip downloading a font resource if the format hints indicate only unsupported or unknown font formats.

This seems to imply that the format() identifier will be used if any of the arguments are known. Instead, in order to support modern and future font behaviors, web authors should be able to list the requirements that the browser needs to understand in order to use a font.

This could either be changing how format() works, adding a new specifier, or something completely different.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0