Webfonts API: using a name instead of fontFamily #41919
Labels
[Feature] Typography
Font and typography-related issues and PRs
[Type] Enhancement
A suggestion for improvement.
Description
I created an Adobe TypeKit provider, but instead of using the font family name, they're using a slug.
Something like that:
https://fonts.adobe.com/docs/api/css_names
The way how the api in the
gutenberg_add_registered_webfonts_to_theme_json
method creates the path "settings.typography.fontFamilies.theme" ignores the name property. This is the result:What is your proposed solution?
I propose to allow the name parameter as a valid props:
https://github.com/WordPress/gutenberg/blob/trunk/lib/experimental/class-wp-webfonts.php#L251-L269
And change the construction, adding a check, something like that:
https://github.com/WordPress/gutenberg/blob/trunk/lib/experimental/register-webfonts-from-theme-json.php#L166-L171
With these small changes, we were able to see a name instead of the font family.
The text was updated successfully, but these errors were encountered: