Displaying Bold Text with the Google Font API`s b Shorthand
In this sixth part of the series, you will learn how to work with the “b” shorthand offered by the Google Font API, which can be used as a quick replacement for the “bold” option discussed in a previous part. The shorthand offers nothing especially difficult to grasp, so you shouldn’t have any problem using it when embedding bold fonts in your own (X)HTML documents.
Displaying Bold Text with the Google Font API`s b Shorthand - Introducing the b shorthand (Page 3 of 4 )
To be frank, the use of the “b” shorthand is very similar to its cousin “i” discussed in a previous installment of the series. So, say that you want to download the bold style of the “Cantarell” font family using the “b” option. In a case like this, the Google Font API should be queried as shown below:
There you have it. As you can see, the URL used to invoke the API offers nothing especially difficult to understand, as its syntax is nearly the same to the one used with other, previous examples. Once the requested fonts have been successfully transferred to the client computer, they can be used in a standard fashion:
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;
Considering that coding CSS styles like the ones shown above is something that you’ve probably done hundreds of times before, I’m not going to spend more time discussing how they work. Now we need to include the styles in a web page, so you can have at hand a working example that shows how to use the “b” shorthand.
That’s exactly what I plan to do in the last segment of this tutorial, so jump forward and read the lines to come.