WordPress / gutenberg

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

Font Library: Google Fonts - generated file names are non-descriptive #58411

Open colorful-tones opened 10 months ago

colorful-tones commented 10 months ago

What problem does this address?

If you add Google Fonts in the Font Library the file names are random strings, e.g. wp-content/fonts/fC1hPYBHe23MxA7rIedwVWytTyk.woff2.

What is your proposed solution?

It would be ideal to likely maintain Google's naming convention, or at least have the font name somehow applied so that site builders could glance at their fonts/ directory and have an idea what fonts are installed without having to try and cross-reference what is available in the Font Library modal and infer a match.

I'm not sure what kind of duplicate checking is already in place, but this may help alleviate duplicate font if there is a naming convention applied.

Screenshot 2024-01-29 at 2 39 47 PM

matiasbenedetto commented 10 months ago

Thanks for flagging this. Here's a potential fix for it : https://github.com/WordPress/gutenberg/pull/58474

matiasbenedetto commented 10 months ago

Should both the manually uploaded font files and those added from a font collection, such as Google Fonts, be renamed?

@colorful-tones, what do you think?

colorful-tones commented 10 months ago

Thanks @matiasbenedetto for the effort here! I left my feedback in the Review. From my perspective - you've addressed the issue, and I approve of your PR. 👍

creativecoder commented 7 months ago

I put together a draft PR that may help with this. It sorts font files (from all collections) into subdirectories using the font family slug. Let me know what you think.

https://github.com/WordPress/gutenberg/pull/60402