In this fifth part of the series, we examine the “bold” argument provided by Google’s Font API. It's used for requesting and downloading the bold style of a specified font family. As with the “italic” option discussed in earlier parts, you should use “bold” on web pages with due caution and responsibility (or in other words, don’t commit the cardinal sin of displaying all your HTML elements in bold!).
Using the Google Font API`s Bold Argument - Introducing the bold option (Page 3 of 4 )
In reality, using the "bold" argument to download the bold style of a specified font family is very similar to working with its cousin "italic." The entire process is limited to passing in the query string the name of the requested font followed by the keyword "bold," separated by a colon (:).
For you to understand more clearly how to use this option, I'm going to modify the web page shown in the previous segment, which in this case will request the bold version of the "Cantarell" font. To accomplish this, the Font API should be queried in the following way:
There you have it. A request made like this will effectively download simultaneously the bold style of "Cantarell" and the regular version of "Nobile." With the typefaces already residing comfortably in the client machine, using them to decorate the H1, H2, H3 elements and and paragraphs of an (X)HTML document is as simple as coding the same CSS styles that you saw in the previous section. Here they are, in case you don't recall how they look:
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;
Since the above CSS code speaks for itself, I'm not going to explain how it works. Instead, it's time to see if the code really yields the expected results when included in a web page.
This will be accomplished in the upcoming section. To get there, click on the link that appears below and keep reading.