Using the Google Font API`s Italic Option with Multiple Fonts
In this third part of the series you will learn how to use the Google Font API for embedding into a web page the italicized versions of two different font families. The entire process is very simple, thanks to the flexibility offered by the API’s “italic” query string argument.
Using the Google Font API`s Italic Option with Multiple Fonts - Using the italic option with multiple font families (Page 3 of 4 )
As I stated in the section that you just read, the Google Font API makes it really easy to download and use only the italic versions of multiple font families. In fact, you already saw how to achieve this using a single typeface; nevertheless, it'd be useful to go one step further and demonstrate how to do the same thing with two font families at the same time, at least for didactic purposes.
So here's the HTML code required for performing the aforementioned task:
As you can see above, downloading the "Cantarell" and "Nobile" fonts in their italic versions is an approachable process that speaks for itself. Obviously, the procedure is as simple as appending the "italic" argument to the name of each font being downloaded, separated by a colon (:). It's that easy.
Once the corresponding fonts are available in the client machine, using them to decorate a few text-based HTML elements is literally identical to the examples that you learned before. The following code snippet shows this in a nutshell:
font: normal 46px 'Cantarell', Helvetica, sans-serif;
font: normal 40px 'Cantarell', Helvetica, sans-serif;
font: normal 32px 'Cantarell', Helvetica, sans-serif;
font: normal 14px 'Nobile', Helvetica, serif;
So far, so good. Now that you know how to use the "italic" option with at least two different font families, it's time to see if the CSS styles coded above really work as one might expect. In the next section I'm going to include those styles into a web page. This will provide you with a complete example which you'll be able to tweak and customize according to your personal preferences.
Now, to see how this example will be defined, jump forward and read the next few lines.