I am quite not sure, if this forum category is the right place for my feature request. Pls move it, if necessary.
I wonder if it is not possible to add a possibility to localize the webfonts.
Currently the fonts are almost Google Webfonts that are called directly form the Google fonts server. In the European GDPR it is recommended to localize the font files so there is no connection to a Google server, which stores personalized data like IP addresses in the US.
Currently I am doing like this:
- I got to https://google-webfonts-helper.herokuapp.com/fonts and search the font I am using (or more than one but than one after the other). I check the styles I want to use and copy the css code. This code I store in a CSS file which I call local-fonts.css and upload it to templates/j51_xxx/css/
- Then i download the prepared ZIP file at the end of the css code section on the webfonts helper page. I unpack it and upload the font files to templates/j51_xxx/fonts/ . Now the references in the CSS file local-fonts.css point to the correct font files (e.g.: url('../fonts/gudea-v10-latin-regular.woff2') format('woff2') points to ../fonts/ which is the directory whrere I uploaded the font files)
- the last step is the most critical one, because it will be overwritten in case of a template update. I open the file templates/j51_xxx/inc/fonts.php. There I disable the lines with the loop, starting with "foreach ($googlefonts as $v) { // loop" and add a line below which contains: $app->getDocument()->addStyleSheet('/templates/j51_xxx/css/local-fonts.css');
Now all my webfonts are called from my local webserver.
Maybe its an idea to set a folderpath in the template for a local fonts file. And if local fonts = YES then set the value also in the fonts.php.
Then the files upload and the local-fonts.css content must still be done by the user, but the danger of overwriting the fonts.php is no longer available.
If this is not possible maybe its possible to add this as tutorial article. In this case I would write it more detailed.
Regards
Oliver