One fear with leaving out Google Fonts support is that there will be many competing solutions in the wild instead of one solid provider that everyone can rely on. Instead of removing it, maybe we could implement them properly, enforcing locally-hosted webfonts to improve performance & privacy? This way we’d be setting a good example, and we’d see a significant performance & privacy improvement in the WP ecosystem as themes & plugins that currently use Google-fonts, Adobe-fonts and whatnot will start to adopt the API.įor now, it looks like local fonts are officially supported, but theme and plugin authors must register custom providers. Related article: German Court Fines Website Owner for Violating the GDPR by Using Google-Hosted FontsĪri Stathopoulos, one of the developers behind the web fonts API, explained that bundling a solution in core that writes the font files directly to the server would improve privacy: If WordPress decides to include support for the Google CDN later on, the implementation will have to consider web privacy laws and restrictions and be tied with an eventual User Consent API, etc. Ozz goes into further details in an earlier ticket, but his recommendation was to drop Google Fonts support for now:Īdd support only for local fonts for now. A Google Fonts provider was part of the original implementation but was later removed. The potential downside is that the feature only ships with support for a local provider, which means fonts must be bundled with the theme. I have tested this extensively and have not run into any problems. Theme authors can now define font-face definitions alongside their corresponding families in theme.json files, and WordPress will automatically load the necessary CSS in the editor and on the front-end. While many wanted to see this feature land in WordPress 5.9, the extra months have given it time to evolve into a cleaner API that integrates with the site and content editors. This was not the holdup for its unveiling, but it will likely be the API’s most common use case. Being only available through PHP meant that theme authors would have mostly been doing what they always have - rolling out their own solution. The API was limited because it did not yet have theme.json support. It was not a popular decision, but it may have been the best direction. However, it was put on hold by Andrew Ozz, one of the lead WordPress developers. By most accounts, the API looked ready to ship with WordPress 5.9. However, it was not until late 2021 that it gained a mass of support and development. Jono Alderson opened the original ticket for a web fonts API in February 2019. Theme authors who want to test it can clone the dev version of the plugin or download the nightly version from Gutenberg Times. The API has been merged into the Gutenberg plugin and should land in version 12.8. After being punted from the WordPress 5.9 release, it was moved to the Gutenberg project, where it could be built alongside related features that relied on it. The journey toward a web fonts API in WordPress has been a rollercoaster of emotions for developers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |