Local Fonts

Local fonts are web fonts that are hosted 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 in Austria. The claimant was successful in arguing that the owner of the web site had breached the General Data Protection Regulations (GDPR) by loading Google fonts. That is, the court agreed, because Google fonts that are loaded from Google, trace the IP address of the person visiting the web site.

Google Fonts is a font embedding service library from Google. It allows developers to add fonts to their Android apps and web sites simply by referencing a stylesheet. As of the date I am writing this, Google Fonts is a repository for 1,455 font families. And is it used by over fifty million websites.

I believe I read that Google claimed that they anonymised the data and do not trace IP addresses of site visitors. Plainly, the court thought otherwise. Another thing for site owners in the UK to bear in mind is the long drawn out withdrawal from the European Union. It leaves the GDPR rules and regulations in a kind of no man’s land. Does GDPR apply if a visitor from France visits a web site located in the UK? What if the host’s server is not located in the UK but in, for example a European country?

GDPR and Brexit

I wrote a long time ago about my personal opinion of GDPR. I said that I thought it was a sledgehammer to crack a walnut except in the case of web sites that gather sensitive information. It is clearly important for web sites relating to minors, medical matters, sexual health matters, etc. But twhat exactly is the mischief that GDPR cures? So what if Google knows that a visitor visited a site selling cards that are available in shops on the High Street? Ah well, I don’t have to think more about it because our fonts on Flying Twigs are served locally.

For self-hosted sites, like Flying Twigs, the process of swapping over to local fonts is doable. You will need the web versions of the fonts. And you can get them using this tool – google-webfonts-helper that identifies the files for Google fonts.

I already did this here on Flying Twigs. And I am working my way through other personal sites that I control. That said, in WP 6.2 it looks as though WordPress will incorporate some method of doing this automatically. It will do it without custom CSS and php code.

If you feel like we do about Brexit, then we have a section devoted to these cards. Here are three of them:

The Functions Code

In order to load local fonts, you have to add php code to the functions file (and then remove it afterwards) is to upload .woff files.

By default the WordPress platform does not allow users to upload certain kinds of file. This is to protect against malicious code being injected.

For those who think this method is too complicated, a WPTavern article on local fonts, and suggests the Bunny Fonts plugin as a way to replace Google fonts. I read the documentation for Bunny Fonts and it seemed just as straightforward to use the GeneratePress method.

There is every reason to think that the GeneratePress method would work on any theme, not that I have tried it.

None of what I have written here applies to web sites hosted on WordPress.com. That is because those sites are controlled above the individual site owner’s head so to speak. That said, for an overview, take a look at JenT’s article on Google fonts and GDPR.