This is a tester plugin for the Web Fonts API. It uses the Jetpack Google Fonts Provider composer package.
This has been modified to match Jetpack's current implementation of the Google Fonts API as of 2023-02-21.
Original Copy was from: https://gist.github.com/hellofromtonya/1bbbc9a5354a905278080a9f022c2f60#file-webfonts-php-L102
- This is only to illustrate a bug. Please don't use for any other purpose.
- In your local dev environment, create a new folder in
wp-content/plugins/
calledwebfonts
. - In a command line tool (such as Terminal), type:
composer install
. - Then activate the plugin in your test site's admin area.
- Open the Site Editor
- Open the Global Styles UI
- Open Typography
- Open
Text
- Select a Google Font
- Expected behavior: The text should change to that font.
- Then go to
Heaings
- Select a Google Font
- Expected behavior: The headings should change to that font.
- Save the global styles.
- Go to the front-end. Then visually check that the text and headings look like for those fonts.
- Check the error log to verify deprecation notices are present.
This plugin has the following fonts. You can visually see how the font should look by clicking to go to Google Fonts website.
- Arvo: Visually see it
- Lato: Visually see it
- Merriweather: Visually see it
- Playfair Display: Visually see it
- Roboto: Visually see it