create-block-theme icon indicating copy to clipboard operation
create-block-theme copied to clipboard

Saving Font Assets from native WP Font Management tooling

Open pbking opened this issue 2 years ago • 1 comments

With the introduction of the Font Manager in WP 6.4 CBT should be able to work with that workflow to manage fonts.

Currently when installing fonts via that tool and then 'Saving' (or exporting) the theme via CBT the Font Face values are added to theme.json (as expected) but the font face resources are referenced from a remote location.

{
	"fontFamily": "Jost",
	"fontStyle": "normal",
	"fontWeight": 500,
	"src": "http://localhost:4759/wp-content/fonts/jost_normal_500.ttf"
}

To address this when a theme is saved (or exported) the Font Face files should be copied (moved?) to the theme's /assets/fonts/ folder and referenced from there.

pbking avatar Sep 06 '23 18:09 pbking

Note: This would probably be addressed by fixing it in Gutenberg instead.

pbking avatar Sep 07 '23 12:09 pbking