Opened 13 months ago
Last modified 3 months ago
#60957 new defect (bug)
Install fonts in Font Library in WP 6.5 not working on multisite using Twenty Twenty-four
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.5 |
Component: | Editor | Keywords: | |
Focuses: | multisite | Cc: |
Description (last modified by )
Fonts install in the e.g. "uploads/sites/8/fonts" directory on the proper "site" in multisite. The new font shows up in the Font Library in Styles Typography, but is not rendered either in the Style Book or the front end.
Here is the theme.json
for the installed font:
"fontFace": [ { "fontFamily": "\"Alegreya Sans SC\"", "fontStyle": "normal", "fontWeight": "500", "src": "http://eosfse.movingmoment.com/wp-content/uploads/sites/8/fonts/mtGm4-RGJqfMvt7P8FUr0Q1j-Hf1DrpG0iFrMYJ_K-4.woff2" }, { "fontFamily": "\"Alegreya Sans SC\"", "fontStyle": "italic", "fontWeight": "500", "src": "http://eosfse.movingmoment.com/wp-content/uploads/sites/8/fonts/mtGk4-RGJqfMvt7P8FUr0Q1j-Hf1BkxdBidhMKB6O-51OA.woff2" } ], "fontFamily": "\"Alegreya Sans SC\", sans-serif", "name": "Alegreya Sans SC", "slug": "alegreya-sans-sc" } ],
Attachments (1)
Change History (9)
#2
@
13 months ago
Hi @hartsook and thanks for the ticket.
I'm unable to reproduce this bug, adding the font via the font library on a sub site displays as expected (see screen shot). The steps I took are:
- Install fresh Multisite installation
- Create sub site
- Install Alegreya Sans SC font via site editor
- Set the new font for all elements (Headings, text, captions, etc) in the style editor
- Save site & open front end, fonts appeared as expected
- Repeat set up for sub-site, fonts appeared as expected
Fonts added via the font library are configured via the global styles, it's not required to add the font library fonts in theme.json. For theme fonts, you can include the file in the theme and reference them with file values.
While looking at the JSON you provided, I also noticed an apparent typo: there are two closing square brackets but only one is opened.
#3
@
13 months ago
@hartsook I've posted a reply but it appears trac had a glitch sending out the notifications.
https://core.trac.wordpress.org/ticket/60957#comment:2
#4
@
13 months ago
- Description modified (diff)
I get mixed content errors in the browser console. The site enforces HTTPS, but the font refers to the unsecured (sub)domain.
#5
@
13 months ago
I am also unable to reproduce this on a fresh Multisite installation.
I'm not sure the theme.json is relevant if the font is installed with the Font Library and the font is applied to the blocks in the Site Editor. Font family changes that are made in the Site Editor are saved in the database and are used instead of theme.json.
Perhaps there are steps to reproduce it that are missing?
After installing the font using the Font library, did you export the theme to get the updated copy of theme.json?
Or did you manually add it to theme.json? For what purpose?
#8
@
3 months ago
Yup, I'm running into the exact same thing but with Twenty Twenty-Five.
This happens on a Multi-site in subdomain mode that is installed on https. Our SSL license has a wildcard subdomain and the server responds with HTST so all traffic is forced to https.
However, sub-sites on subdomain installations will be created with home and siteurl in http scheme. This does not appear to hinder anything except in the case of font files that were installed via the Site Editor.
These files are referenced over http in the front end page source, which means they are blocked as mixed content by the browser, breaking any custom font rendering.
If I go to the Network > Sites and manually change http to https in the home and siteurl fields for the sub-site, the issue is resolved. But it's annoying to have to do that on each new sub-site...
So to reproduce:
- prepare your server/domain for https with a subdomain wildcard
- set up a permanent redirect of all http traffic to https
- create a multi-site installation in subdomain mode (not subdirectory)
- create a sub-site (as an anonymous user via the front end for good measure)
- log in as new user into your new site and go to Editor > Styles > Edit styles > Typography > Fonts > Install fonts
- Install a new font from Google Fonts and then set regular Text or Headings to use that font
Visit the site home page and notice the new font is not rendered and a mixed content error occurs in the browser console.
To "fix":
- log back in as super-admin and go to Network > Sites
- Edit the new site Site URL from http to https
- Go back to the new sub-site and repeat the above to re-install a font (you will need to uninstall the failing font)
BTW, the html/css thinks it's getting the Alegreya Sans SC, but that's not the font that's being displayed:
h2 {
}