Plugin to download Google Fonts

I’m setting up a new site with grav and am using Antimatter as theme. When checking the site I realized that the site loads Google Webfonts. I dislike it when visitors are sent to 3rd party sites. So I try to think about possibilities to omit that.

So I can download the fonts and change the theme to load everything locally. Another possibility would be to copy the theme and make changes there.

Another idea would be having a plugin which downloads the fonts and sets up the themes in a way that they use the fonts from the local installation. Do you know about such a plugin? Is it possible to build such a plugin?

Or generally speaking: What would you suggest to deliver fonts from my own site? (It would be perfect if I could use it among different themes and if a change of a theme wouldn’t affect this behavior)

@grjk : welcome to the grav community :smiley:
instead of changing the original theme (antimatter in your case) you should consider creating a child theme - see theme inheritance.
this way, you can always profit from updated versions of your parent theme.
as for your 2nd idea (plugin): this seems not to be easy to do in a generic way, as the usage of Google Webfonts is always done in different ways.
additionally, just using the Google Webfonts Helper is quite easy, search your desired font(s) and styles, download the zip file and copy the generated CSS to your child theme’s corresponding CSS file (e.g. fonts.css), and you’re done.

1 Like

Thanks. I hadn’t read about inheritance so far, but this sounds perfect.

you’re welcome - yes, theme inheritance is the right thing for the described task, see also the official docs.

1 Like