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

Fonts not differentiated by unicode-range #48813

Open
strarsis opened this issue Mar 7, 2023 · 0 comments
Open

Fonts not differentiated by unicode-range #48813

strarsis opened this issue Mar 7, 2023 · 0 comments
Labels
[Feature] Typography Font and typography-related issues and PRs [Type] Enhancement A suggestion for improvement.

Comments

@strarsis
Copy link
Contributor

strarsis commented Mar 7, 2023

Description

Fonts that are registered with the Fonts API (including by theme.json) are currently not differentiated by the unicode-range.

convert_variation_into_handle only uses the font-weight and font-style for generating a handle, not unicode-range.
https://github.com/WordPress/gutenberg/blob/trunk/lib/experimental/fonts-api/class-wp-fonts-utils.php#L53

Just adding unicode-range to the array of processed properties solves the issue. But unicode range normalization may be required to ensure that fonts with same unicode-range but differing notation of the unicode-range are treated as identical.

Step-by-step reproduction instructions

  1. Declare two font files for a font-face with same parameters, except for a unicode-range.
  2. Notice that the font face of only one font file is eventually enqueued, all the other font files will not be usable.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@kathrynwp kathrynwp added the [Type] Enhancement A suggestion for improvement. label Mar 7, 2023
@annezazu annezazu added [Feature] Typography Font and typography-related issues and PRs and removed [Feature] Fonts API labels Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Typography Font and typography-related issues and PRs [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants