WordPress / gutenberg

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

Automatically list all unused Fonts of a Block theme #65152

Open charliecha67 opened 1 month ago

charliecha67 commented 1 month ago

Would be nice to add a way to list automatically all the fonts that are not used in a Block theme.

Because when loading (too) many fonts via theme.json > typography > fontFamilies > fontFace , it is a long job to manually find all unused font ( in order to remove them ).

I guess my request is close to this one : https://github.com/WordPress/gutenberg/issues/55175

Thank you

matiasbenedetto commented 1 week ago

I think that searching fonts usage in a theme could be done somewhat fast but a font can be also used for a particular element/block of a post or a page. Knowing that would be expensive to calculate. Should we read every post in the database to be sure that the fonts isn not in use?