Local Fonts

Local fonts means the the web-font is on the server that hosts the website. A web font is recognisable from the .wof and .wof2 file type.

JenT posted a helpful post on the consequences of a court case where the claimant was successful in arguing that the owner of the web site had breached GDPR regulations by loading Google fonts because Google fonts trace the IP address of the person visiting the web site.

As Hacker News points out, Google Fonts is a font embedding service library from Google, allowing developers to add fonts to their Android apps and websites simply by referencing a stylesheet. As of January 2022, Google Fonts is a repository for 1,358 font families and is used by over 50.1 million websites.

For self-hosted sites, which our e-commerce site at FLYING TWIGS is, then the process of swapping over to local fonts is doable. We use GeneratePress and this an Adding Local Fonts page in the documentation on how to pull down Google fonts and host them locally using this tool – google-webfonts-helper that identifies the files for Google fonts.

I have already done this on Flying Twigs and I am working my way through other sites. That said, in WP 6.2 it looks as though WP will incorporate some method of doing this without having to add custom CSS and without having to temporarily add php code to the functions file to allow uploading .woff and .woff2 files.

The code one needs to add (and then remove once one has uploaded the .woff files) to the functions file is to allow uploading .woff files, which to protect against malicious code being injected, are normally not allowed.

WP Tavern has articles on local fonts, and suggests Bunny Fonts as a plugin as an easier way to replace Google fonts. I read the documentation for Bunny Fonts and it seemed just as straightforward to use the GeneratePress method. And there is every reason to think that the same GeneratePress method would work on any theme, not that I have tried it. And it would work with any web font that one might buy and download.

All this said, none of this applies to WP.com that operates above the site owner’s head so to speak, but for an overview I recommend WPCOMMAVEN’s article on Google fonts and GDPR.





%d bloggers like this: