Skip to content

[css-fonts-4] [varfont] Allow access to named instances outside of @font-face #2972

Description

@rsheeter

#525 added access to named instances by specifying font-named-instance in @font-face.

For other aspects of a variable font you can specify on @font-face OR elsewhere. For example, font-variation-settings (https://drafts.csswg.org/css-fonts-4/#font-variation-settings-def) will let you use the font-face with different axis positions and font-display can be changed outside the @font-face with @font-feature-values (https://drafts.csswg.org/css-fonts-4/#font-display-font-feature-values).

Is it plausible that a mechanism be defined such that a font-named-instance be set outside of @font-face? Just allow font-named-instance in more places similar to font-variant-alternates?

For Google Fonts and other central services this would be very convenient: ask for a variable family and then access all sorts of fun parts of it. For example:

@import url('https://fonts.googleapis.com/css?family=Markazi+Text');

body { font-family: 'Markazi Text'; }

/* Here I can change axis positions (font-variation-settings) or set a font-display using @font-feature-settings but I can't change my axis positions using the named instances carefully defined by my type designer 😞 */
h1 { font-named-instance: 'Markazi Text Light'; }
h2 { font-named-instance: 'Markazi Text Bold'; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions