WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.23k stars 4.08k forks source link

Deactivating a theme font removes it from the Font Library #60392

Open creativecoder opened 4 months ago

creativecoder commented 4 months ago

Description

After de-activating a theme font variant (font face), it no longer appears in the Font Library modal.

Step-by-step reproduction instructions

Using the TT4 theme

Screenshots, screen recording, code snippet

https://github.com/WordPress/gutenberg/assets/1699996/02a26a99-e0b6-4d09-8d80-b061668257a7

Environment info

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

t-hamano commented 4 months ago

I was able to reproduce it on WordPress 6.5 without the Gutenberg plugin enabled.

Also, I noticed the following:

https://github.com/WordPress/gutenberg/assets/54422211/d59ec5d4-f051-4115-90cb-c58af8ff88fb

matiasbenedetto commented 4 months ago

This behavior is forced by the fact that we can't easily know which are the base fonts when a theme style variation is added to the global styles. When a theme style variation is added to the Global Styles, the 'base' theme fonts coming from the theme.json file are no longer relevant, but we can't use the style variation as 'base' because there's no indication of which the theme variant active is.