Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

WIP: Implement the webfonts API#95

Closed
aristath wants to merge 1 commit intoWordPress:trunkfrom
aristath:try/webfonts-api
Closed

WIP: Implement the webfonts API#95
aristath wants to merge 1 commit intoWordPress:trunkfrom
aristath:try/webfonts-api

Conversation

@aristath
Copy link
Copy Markdown
Member

In WordPress/wordpress-develop#1736 we're working on a webfonts API for WordPress Core.
This PR is a companion to the core patch, to test the API.

Eventually, the goal is to have webfonts defined in the theme.json file, but in this 1st iteration we're using a wp_register_webfonts function.

@aristath
Copy link
Copy Markdown
Member Author

Also see WordPress/gutenberg#35591 in the Gutenberg repo regarding implementing the webfonts schema in theme.json.

Comment thread functions.php Outdated
@aristath
Copy link
Copy Markdown
Member Author

Once the core patch gets merged and we have an implementation in Gutenberg for theme.json, we should add the below in theme.json, under settings.typography:

"webfonts": [
	{
		"fontFamily": "Source Serif Pro",
		"fontWeight": "200 900",
		"fontStyle": "normal",
		"fontStretch": "normal",
		"src": "file:./assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff2",
		"provider":"local"
	},
	{
		"fontFamily": "Source Serif Pro",
		"fontWeight": "200 900",
		"fontStyle": "italic",
		"fontStretch": "normal",
		"src": "file:./assets/fonts/source-serif-pro/SourceSerif4Variable-Italic.ttf.woff2",
		"provider":"local"
	}
]

@kjellr
Copy link
Copy Markdown
Collaborator

kjellr commented Jan 10, 2022

I'm going to close this one for now, since it's outdated and the corresponding PR isn't going to be a part of 5.9.

@kjellr kjellr closed this Jan 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

[Type] Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants