Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support @font-feature-values #837

Open
yisibl opened this issue Oct 16, 2024 · 4 comments · May be fixed by #840
Open

Support @font-feature-values #837

yisibl opened this issue Oct 16, 2024 · 4 comments · May be fixed by #840

Comments

@yisibl
Copy link
Contributor

yisibl commented Oct 16, 2024

@font-feature-values Inter {
    @character-variant {
        cv05: 5;
        cv08: 8;
        cv10: 10;
    }
    @styleset {
        ss01: 1;
        ss08: 8;
    }
}

image

image

@yisibl
Copy link
Contributor Author

yisibl commented Oct 17, 2024

Also, following the principle of retaining only the last-defined value, as well as the principle of shortest representation, multiply-specified tuples and multiple blocks are serialized as a single block containing only the last-defined value.

For example, the declaration: https://drafts.csswg.org/css-fonts/#ex-serialize-same-font-feature-values

/* Repeated declaration names, and multiple blocks of the same type*/
@font-feature-values foo {
  @swash { pretty: 0; cool: 2; }
  @swash { pretty: 1; }
}

would be serialized as:

/* Canonical serialization */
@font-feature-values foo {
    @swash { cool: 2; pretty: 1; }
}

@yisibl
Copy link
Contributor Author

yisibl commented Oct 17, 2024

Note that when compressing, we also need to handle special versions of Firefox that don't remove the ending semicolon.

@font-feature-values FontName {
  font-display: whatever;
}

https://x.com/pjchrobak/status/1059229076987301888

@CGQAQ CGQAQ linked a pull request Oct 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@yisibl and others