In this fourth part of the series, I demonstrate how to work with the “i” option provided by the Google Font API. It can be used as a shorthand for the “italic” argument discussed in previous tutorials. The process is extremely straightforward, so you shouldn’t have major problems replicating it when developing your own web pages.
Are you a web designer tired of using the same font families over and over again on your websites, enclosed in a boring and annoying world where Arial, Verdana and Tahoma seem to be the only choice for decorating your text-based HTML elements? Well, if that is the case, take a peek at the Google Font API. This is a brand new web service which gives creative designers the ability to embed for free a decent amount of commercial fonts on their web pages by using a set of easily customizable options. What’s more, consuming the API is as simple as including an external style sheet in an (X)HTML document and passing to it the names of the typefaces that you want to download from Google’s cloud of servers. It's that simple.
The API provides a few additional features that you may find interesting when you want to really spice up the appearance of your HTML elements. It will permit you to include only the italic and bold styles of a given font family, thus saving precious bandwidth and making your web pages load even faster.
Naturally, my previous marketing speech would be just that if I didn't provide you with some concrete examples that show how to use the most relevant features that come with the Google Font API. In keeping with this idea, in the preceding tutorial of this article I discussed how to work with the “italic” option of the API, which helps you download (when available) the italic version of one or multiple typefaces. It’s possible, however, to use a shorthand for this option. Instead of passing the word “italic” when querying the API, you can specify the letter “i” in the query string, and the result will be exactly the same.
Even though personally I prefer to use the entire term “italic” because it’s a bit more readable and intuitive, in this fourth chapter of the series I’m going to explain how to utilize the aforementioned “i” shorthand. This way you can choose the syntax that best fits your needs.
Ready to learn a few more interesting things about the “italic” option offered by Google’s Font API? Then jump ahead and read the lines to come!