815 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Contributed a free file of the month
+3 more
rvision_ says

Hi what we recommend is:

1. Create an internal script on your server which connects to the GoogleFont Library through your API and loads the fonts (e.g. via cron once per week) and cache these results on your server to avoid the API calls limit.

2. Create a script which can be called from your themes which will return the Cached results and the theme will be able to handle and use the output.

3. In order to avoid overload of your server, make sure the theme connects to your server just from time to time and it caches the output. Use the Transients API for that http://codex.wordpress.org/Transients_API

I guess this is it ;)



In my WP plugin I’m using script on my server which caches font list for 1 day and is called as JSONP.

1 post
  • Has been part of the Envato Community for over 6 years
  • Has collected 1+ items on Envato Market
  • Located in United States
pdclark says

I was needing this recently for the Styles plugin, and I noticed that phat-reaction.com/googlefonts.php was fairly out-of-date.

As a solution, I wrote a WordPress plugin that can run independently for testing, or as an include in any other plugins and themes. You can read more about it and see a screenshot on Github: github.com/stylesplugin/styles-font-dropdown.

This drop-in class has several nice features:
  • Automatic updates: Updates from Google’s Font API automatically, caching for 15 days. (Interval can be changed.)
  • Search and style the menu: Uses the Chosen library, allowing users to search the font list and you to style as you’d like.
  • Degrades gracefully: If you don’t set a Google Fonts API for yourself or your users, it falls back to a Google Font list stored in the plugin
  • Deploy with or without an API key: If you set a Google Fonts API on your development machine, it will update the cache file for you to deploy to your users.

I’d be happy to hear your input. If you run into any issues, please report it on Github. I hope to include it in the Styles plugin for all themes in the near future.

32 posts
  • Has been part of the Envato Community for over 2 years
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Deveraux says

Just to get TortoiseHg and just click on update once a week on your local google fonts map and use the attached tools to get all the fonts. That way you can much more easily handle subsets of fonts like Cyrillic, Greek etc.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes