User Tools

Site Tools


loading_google-fonts_locally_for_gdpr-_and_performance-reasons

In order for Google to be able to provide fonts, websites automatically load the fonts via a Google server in the USA each time they visit the site. In return, Google reads numerous data from website visitors via a cookie. This includes

  • the browser,
  • the website the user is visiting,
  • the user's operating system,
  • the user's screen resolution
  • the user's IP address and
  • the language settings of the browser.

This is personal data. Website operators are not allowed to collect this data without the consent of users and forward it to Google.

In combination with the other data collected, website operators also enable Google to create a user's fingerprint, which allows Google to recognise the user on other websites visited. Data protectionists assume that Google stores all retrieved user data and uses it for tracking purposes.


It is important to get your website GDPR- and DSGVO-compliant!

So how to get rid of fonts, served by Google, and load them directly from your GetSimple-Site?

First: Google-Fonts are openSource, you can check the valid license for your font here: https://fonts.google.com/attribution you will see that they use “SIL Open Font License, 1.1”, which gives freedom to use font software for any purpose, http://scripts.sil.org/OFL

Now start to modify your font-use, you will have to modify some of your theme's template-files and css-files and you will need to download font-files for local storage

1) go to the Google-Fonts-Helper at: https://google-webfonts-helper.herokuapp.com/fonts

2) in the left sidebar, select the font which you wan to embed locally

3) in the right sidebar, select the charset and font-weights

4) decide whether you need “best support” variant to serve older browsers or “modern Browsers”

5) customize the path where you want to place the font-files, here the folder “fonts” in your theme-directory (in php-speech!):

 <?php get_theme_url(); ?>/fonts/ 
 

6) Now copy the created css and save it as fonts.css in your theme-css-directory: e.g.:

 /theme/yourtheme/css/

7) download the ZIP which is created on the fly, unpack it into the fonts-folder:

 /theme/yourtheme/fonts/

8) edit the headerfile of your theme (f.e. inc_header.php) and delete the reference to google:

 
<link href='https://fonts.googleapis.com/css?family=YourFontFamily...' rel='stylesheet' type='text/css'/>)

add this line instead:

 
 <link href="<?php get_theme_url(); ?>/css/fonts.css" rel='stylesheet' type='text/css'>
 

9) make a backup of your actual GetSimple-Installation and then load up all the relevant files by FTP

10) clear your browser's cache and open the website in your browser. If everything looks good, you are a winner and have the wonderful feeling to the website compliant with GDPR and DatenSchutzGrundVerordnung!

loading_google-fonts_locally_for_gdpr-_and_performance-reasons.txt · Last modified: 2022/11/17 14:21 by Connie