Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scaffold for usage of the Fonts API introduced in 6.5 #102

Open
Tracked by #112
fabiankaegy opened this issue Apr 7, 2022 · 6 comments
Open
Tracked by #112

Add scaffold for usage of the Fonts API introduced in 6.5 #102

fabiankaegy opened this issue Apr 7, 2022 · 6 comments
Assignees
Labels
blocks enhancement New feature or request

Comments

@fabiankaegy
Copy link
Member

WordPress 6.0 will likely include the new Webfonts API which will make it much easier to register and load custom fonts. This should be incorporated into the scaffold.

@fabiankaegy fabiankaegy added the enhancement New feature or request label Apr 7, 2022
@fabiankaegy fabiankaegy added this to the WordPress 6.0 milestone Apr 7, 2022
@dainemawer
Copy link
Contributor

@fabiankaegy apologies for only getting back to you on this so late. How can we make this happen? Super exciting!

@fabiankaegy
Copy link
Member Author

@dainemawer WordPress/gutenberg#37140 is the PR where the Webfonts API got introduced into Gutenberg. The same core is now in 6.0 and we need to determine what the best practices are we want to advise for its usage.

I'm happy to work on the setup to build some scaffolding but I would look to you for guidance on what we should do from the performance perspective to set up our defaults correctly.

First and foremost I think it would be great to get some insight from you whether the way the fonts get loaded by this API out of the box meets all the criteria you have for properly loading fonts. If that is the case I can move this forward.

If there are issues I'd love to see us work with core to improve these issues and also see if we can come up with workarounds in the meantime

@dainemawer
Copy link
Contributor

@fabiankaegy sounds great to me! Could we setup a branch with the inherent functionality to start with so I can take a look? I can probably make further suggestions from that point. Lacking a bit of time to dive into the setup myself, but if you can get the foundation up and running which I can clone down I think we can make short work of this! Exciting times!

@fabiankaegy
Copy link
Member Author

@dainemawer I will set up something for you 👍. However, I just want to flag that there are some conversations currently that the API may be postponed again. See here: https://wordpress.slack.com/archives/C035NHLFUSY/p1650386056181749

There will be a post on make.wordpress.org soon going into depth on the various reasons.

It also currently isn't in the Betas. So I'm not confident we will get this with 6.0 anymore. Its good to get ahead of things anyways and test it now because it actually allows us to participate more in shaping it if you find any issues with the current implementations.

@dainemawer
Copy link
Contributor

@fabiankaegy makes a ton of sense. Lets get ahead of the curve and we can pivot as necessary?

@fabiankaegy
Copy link
Member Author

Just for context this here is the latest overview of the Webfont API in core: https://make.wordpress.org/core/2022/04/22/status-of-webfonts-api-for-wordpress-6-0-inclusion/

It looks like we will get a stripped-down version that only allows registration via theme.json. The actual underlying PHP API will not be available for anyone except for core because it is not jet stable enough.

I had tried to get a draft PR going with Beta 2 and the Gutenberg plugin but failed. Will try again now with Beta 3 which should include the theme.json parts of the Webfont API

@fabiankaegy fabiankaegy changed the title Add scaffold for usage of the Fonts API introduced in 6.0 Add scaffold for usage of the Fonts API introduced in 6.5 Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocks enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants