-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Description
When I register custom font families with variable font files in .woff2 format into my theme.json, the browser doesn't seem to understand the font format and the "variable" properties doesn't work.
Tested up with WordPress 5.9.3 + Gutenberg 13.2.1 and a webfont registration via theme.json in a custom Block Theme (as explained in #37140 PR).
Maybe I'm wrong, but it seems to be the format declared in the @font-face that is incorrect. I believe that a variable font file in .woff2 format should be declared with format('woff2' supports variations) hint.
Currently, it's the Webfonts Provider that deduces the format. Wouldn't it be better to leave the possibility to declare the "format" inside src array (via PHP or theme.json) for each source file?
Step-by-step reproduction instructions
- Register a new font family with local
.woff2variable webfont file as source - Apply font family to Heading block
- Try to change font weight, doesn't work
Screenshots, screen recording, code snippet
No response
Environment info
- WordPress 5.9.3, Gutenberg 13.2.1 with Custom Block Theme
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