WordPress

Proposed Web Fonts API Not Coming to WordPress 5.9, Possibly Landing in Gutenberg First – WP Tavern

Summary

After what seemed like a shoo-in for WordPress 5.9, a proposed web font API was put on hold. The feature would standardize how theme and plugin developers load fonts and lay the groundwork for future user-facing features.

Jono Alderson opened a ticket for the feature in February 2019. In recent months, the proposal picked up speed. The pull request had over 200 in-ticket messages, 93 commits, and code approval from two core committers. The API seemed ready. …….

npressfetimg-249.png

After what seemed like a shoo-in for WordPress 5.9, a proposed web font API was put on hold. The feature would standardize how theme and plugin developers load fonts and lay the groundwork for future user-facing features.

Jono Alderson opened a ticket for the feature in February 2019. In recent months, the proposal picked up speed. The pull request had over 200 in-ticket messages, 93 commits, and code approval from two core committers. The API seemed ready. However, it hit a standstill in the past few days.

Andrew Ozz, a lead WordPress developer, essentially halted the possibility of the new API landing in 5.9. He stated that he did not think the proposal was ready for WordPress.

“Purely as code it looks good,” he wrote in the ticket. “It is really well documented (thanks [Tonya Mark]!). However I still cannot see how this would make WordPress better in the short and long run. We were chatting with [Andrei Draganescu] and he suggested that ideally this should have been a feature plugin, and I agree. Then it would have been possible to really test it in production, verify (or reject) the assumptions that were made while creating it, and make it into a really worthy addition to WordPress. Unfortunately it’s too late for this now for 5.9.”

One of the issues with testing feature plugins for APIs is that they are not often adopted, as others noted in the ticket. Developers would not rely on them in production in most cases. And, the average end-user would not install something specific to developers.

“Suggesting this be done as a feature plugin is an elegant way to delay something for a few years,” said Ari Stathopoulos, one of the developers behind the API. However, he pointed out the REST API being one exception that performed well enough to get ported into WordPress.

The core WordPress proposal will likely be pushed into the Gutenberg plugin for further exploration. This would be a sort of compromise between launching as a separate feature plugin and going into WordPress 5.9.

The web fonts API is not directly related to the block system. Both traditional and block themes, as well as plugins, could make use of the feature today. However, several Gutenberg proposals rely on the existence of the API, such as allowing theme authors to define web fonts via their theme.json files.

Ozz listed several questions around the proposal, and several developers replied to each. However, his primary argument hinged on the practicality of why everything in the API was necessary, stating that prior replies had been “in principle” and seemed to be based on assumptions.

On the most basic level, the web fonts API would allow developers to register and load locally-hosted fonts or those from Google Fonts. Developers could also add custom providers outside of the two defaults. The first iteration of the proposed API was more about setting down a foundation to …….

Source: https://wptavern.com/proposed-web-fonts-api-not-coming-to-wordpress-5-9-possibly-landing-in-gutenberg-first