WordPress / create-block-theme

A WordPress plugin to create block themes
https://wordpress.org/plugins/create-block-theme/
GNU General Public License v2.0
330 stars 52 forks source link

6.3 latest beta - Removed font is still visible in the editor drop-down picker and has settings associated with it (video). #422

Closed Ren2049 closed 6 months ago

Ren2049 commented 1 year ago

This is still happening after clearing all data from Firefox on Mac, stopping/restarting the localwp server and logging back into the site. The video shows the state right after logging in, and as you can see there is no font installed other than the system font.

I'm using a blank theme and the 6.3 beta 4 version with some global styles modifications through the editor and a query loop layout modification, I didn't change anything in theme.json or other files.

Not directly related to the issue but previously I've tested different versions of the variable Figtree font from Google because the font-weights weren't applied correctly when setting up the font in global styles, it always appeared to use the regular weight adding faux boldness on top. It never picked up the lighter variants or actual bold variants of the font – should I open another issue for this?

I've tested the original variable TTF downloaded from Google, one by adding a Google font through the button in the plugin, and a subsetted woff2 version here: https://gwfh.mranftl.com/fonts

I had this glitch in another previously generated version of this theme (I've regenerated a blank theme after the last WP beta update) but the first times I've removed the Figtree font it was also removed from the editor. This time not though..

You can see that on selecting the Figtree font it has still the previous sizings associated with it.

https://github.com/WordPress/create-block-theme/assets/133038357/2633dfcd-1f58-4000-b4d2-e6a90bf38704

vcanales commented 1 year ago

Thanks for the report. I haven't been able to reproduce this using 6.3-RC1; I'm wondering if this is something that was fixed along the way. If not, I would appreciate any additional details you may be able to provide.

Ren2049 commented 1 year ago

Gonna test it again in the coming days. Did you try adding and removing fonts a couple of times and in different font formats (ttf, woff2, variable non variable) and switching themes? Maybe that's where it got tripped up somehow.

matiasbenedetto commented 1 year ago

@Ren2049 I have seen some cases where an entire copy of the theme.json data is stored in the database overriding the fonts from the theme.json file. I'm not sure why this happens, but by your description, it can be related to that.

This thread looks related to what you are describing. Try resetting you global styles as I suggest in the forums: https://wordpress.org/support/topic/local-font-not-added/

Ren2049 commented 1 year ago

@matiasbenedetto the option to reset global styles shown in the wp.org screenshot doesn't show up in my blank theme running 6.3 RC1:

no-reset-options

I have Adminer locally, is there a way to find these entries in the database to verify that it's the same problem? Which table should I search?

matiasbenedetto commented 1 year ago

@matiasbenedetto the option to reset global styles shown in the wp.org screenshot doesn't show up in my blank theme running 6.3 RC1

If you cannot see that option, you don't have global styles saved in the database. Is the "Figtree" font family still in the theme.json file? If you are still experiencing this problem share your theme.json file contents, please.

Ren2049 commented 1 year ago

Yes the Figtree font is still in theme.json

here's my theme.json:

{ "$schema": "https://schemas.wp.org/wp/6.3/theme.json", "settings": { "appearanceTools": true, "layout": { "contentSize": "620px", "wideSize": "1000px" }, "spacing": { "units": [ "%", "px", "em", "rem", "vh", "vw" ] }, "typography": { "fontFamilies": [ { "fontFamily": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif", "name": "System Font", "slug": "system-font", "fontFace": [] }, { "fontFamily": "Figtree", "slug": "figtree", "fontFace": [ { "fontFamily": "Figtree", "fontWeight": "400", "fontStyle": "normal", "src": [ "file:./assets/fonts/figtree_normal_400.woff2" ] } ] } ] }, "useRootPaddingAwareAlignments": true }, "templateParts": [ { "area": "header", "name": "header" }, { "area": "footer", "name": "footer" } ], "version": 2 }

When I remove the font through the plugin it's removed from theme.json, but still visible in the global styles drop-down picker.

Now when adding a new figtree font (e.g. a downloaded variable ttf version from Google) it's correctly added to theme.json, but picking Figtree from the drop-down for the "text" global style has no effect, the default serif font is still showing.

pbking commented 6 months ago

Font-related bug for a feature that is now managed in core. Doesn't seem to be relevant for the remaining font-related bits that remain.

Closing.