My new project, which sadly does not yet have a codename (or a T-shirt), will be using Google Fonts and allowing its users to use them as well. Here are a set of useful resources on Google Fonts:
- To use Google Fonts, you will need an API key. Here’s a quick, slightly out-of-date tutorial on how to get one.
- From Google: Optimizing the use of the Google Font API.
- From Google: Streamline your web font requests. Introducing “text=”.
- Article: Cache Google Web Fonts Api.
- Google Fonts list of fonts.
- Google Fonts main developer’s page (where you get the API key).
The Google Fonts “courtesy license” allows 10,000 API calls per day per API key. Caching the fonts after a pull, as shown in the article above, should both reduce the overhead at the site using the plugin as well as the hits against Google’s API. Even so, we’ll provide an option for users to enter their own API code.
Still not decided is if there will be code limiting API calls on a per-user basis, to drive them to getting their own API key.
Update: after some consideration, I’m not going to screw around with API limiting (or caching), at least initially. For all I know, this plugin will be used by four people and there’s no need to build out some massive chunk of additional complexity. For now, I’m just going to leave a field where users can enter their own API key and a link where they can get it.