You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My assumption is that we want more broad support for font families on sites that need them ( especially for headings and paragraphs ), but we might want to leave it out of other sites.
I am considering this using the new wp_get_global_settings() function to determine if the active theme has font family settings in theme.json. Then we could enable or disable supports.typography.__experimentalFontFamily for all blocks that have typography settings.
Then we could enable or disable supports.typography.__experimentalFontFamily for all blocks that have typography settings.
This would be done through a filter on the blocks? Something like editor.BlockListBlock?
EDIT: Or am I just misreading this and the way it works is that if we add fonts to the settings.typography.fontFamilies setting, they will just appear in the editor in the appropriate blocks?
A fontFamilies preset has been added. Themes can now provide a list of fonts to be displayed to the user in the blocks that support the font family style. WordPress doesn’t provide any font family by default.
If so, without us having to write extra logic to do so, then I think it's a good plan.
This would be done through a filter on the blocks? Something like editor.BlockListBlock?
While testing I used a server-side filter on register_block_type_args
Or am I just misreading this and the way it works is that if we add fonts to the settings.typography.fontFamilies setting, they will just appear in the editor in the appropriate blocks?
Only if the block supports font families, which is tied to support for typography.__experimentalFontFamily. I'm proposing we enable that for any block that has any typography settings at all.
Problem
The documation for WordPress 5.9 mentions the availability of
settings.typography.fontFamilies
for "blocks that support the font family style".https://make.wordpress.org/core/2022/01/08/updates-for-settings-styles-and-theme-json/
The best we have for a complete list of which blocks support them is a search result from the gutenberg repo:
https://github.com/WordPress/gutenberg/search?q=__experimentalFontFamily
As linked from this issue.
WordPress/gutenberg#35920
Questionable Solution
My assumption is that we want more broad support for font families on sites that need them ( especially for headings and paragraphs ), but we might want to leave it out of other sites.
I am considering this using the new
wp_get_global_settings()
function to determine if the active theme has font family settings in theme.json. Then we could enable or disablesupports.typography.__experimentalFontFamily
for all blocks that have typography settings.References
The text was updated successfully, but these errors were encountered: