-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Webfonts: Fix webfont loading in the Site Editor #40262
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, this fixes the issue for me! As noted by @jffng, the previews do not get the correct font though. |
This may be unrelated, but I'm not seeing the secondary font weights loaded in (on both the front end or the back end). This is not a problem for Inter or Source Serif (since those are variable fonts), but it's an issue for DM Sans: ^ In this example, the post title should be bold, but that 700 weight is never loaded in. |
@gziolo since this fixes a bug with style variations, can this be marked for backporting to Core? |
I am AFK the next few days so if someone wants to finish this off please be my guest... |
It would be problematic for TwentyTwentyTwo and style variants without this. |
See #39889 and the note from @hellofromtonya:
The code is stil in the |
Sorry @jasmussen the section was added without knowing that WebfontsAPI hasn't merged into the Beta 1. |
Thanks everyone for the comments. Since this fixes the issue described and the tests are passing, any objections to merging this? It sounds like there is still the decision to be made whether Webfonts makes it in to 6.0, which means TT2s style variations would lack custom fonts. We could enqueue fonts for the style variations the old way, but I don't think that's a good idea or precedent to set. |
Yeah, I agree there. Part of the allure of styles is the ability to swap out a variety of styles: fonts, colors, image treatments, settings etc. We can technically build in more font support manually, but it would be an unfortunate way to do things since this is so close otherwise. The feature is still listed as a must-have for RC: #40139 |
What?
This ensures that all Webfonts from all variations are loaded in the Site Editor
Why?
We need to load all Webfonts for every variation so that when a user previews the variation they see their fonts.
How?
The merging of Webfonts assumed that they
fontFamilies
were stored undersettings > typography > fontFamilies
but they are actually under settings > typography > fontFamilies > theme`.Testing Instructions