Say Hi To WordPress Web Fonts API

Say Hi To WordPress Web Fonts API

Say hi to WordPress Web Fonts API.

We were all waiting for you and we are very glad that you are finally here.

The world thought that WordPress 5.9 will have this feature but that was not the case.

Say Hi To WordPress Web Fonts API

Andrew Ozz said:

“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.”

Developers from all parts of the world waited for many years, since 2019, to have the WordPress Web Fonts API.

Back then, Jono Alderson opened this original ticket for a web fonts API but only in 2021, it gained huge traction – support and development.

The API is part of the Gutenberg plugin and we will have it in version 12.8.

If you are a theme author and you want to test it, clone the developer version of the plugin or simply download Gutenberg Nightly.

How will the WordPress Web Fonts API help you

Theme authors can easily define font-face definitions in theme.json files, and WordPress will automatically load the necessary @font-face CSS in the editor and on the front end.

The not-so-great thing about this is that the API will only load the fonts that are bundled with the theme.

Google Fonts for example was removed.

Andrew Ozz, a lead WordPress developer recommended to drop Google Fonts support:

Add support only for local fonts for now. 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.

Ari 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:

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.

Many developers tried the new API and they all said that it works extremely well.

WordPress websites will benefit a lot from the WordPress Web Fonts API

There are quite a few ways to make your WordPress site look and feel better.

My favorite one is by adding custom fonts.

Fonts play a major role in any design.

A great font will fully transform your website, making it eye-pleasant, easy to read, and navigate.

Conclusions

Standardizing the implementation of local fonts can only be a plus for WordPress, which is constantly becoming better and better.

Leaving out Google Fonts from WordPress web fonts API doesn’t seem to be a good thing. But hopefully it will be added back.

WordPress should have a strong and solid provider that everybody can rely on.

Otherwise there will be many competing players.

But there are also people that consider it a great plus, without Google Fonts, WordPress is more font decentralized and people can start to be more creative.

Let’s see how the WordPress web fonts API will work out its way in developers hearts.