In this penultimate part of the series, I take a detailed look at the “bi” shorthand included with the Google Font API. It can be used as a replacement for the “bolditalic” option covered in a previous article. Since the function of the suffix “bi” is nothing but to query the API using a shorter and more compact syntax, its implementation should be extremely straightforward.
Google Font API: Using the Bi Shorthand - Introducing the bi shorthand (Page 3 of 4 )
As one might expect, the use of the "bi" shorthand is quite similar to working with its counterparts, “i” and “b,” discussed in previous parts of the series. However, even though the theory that surrounds the implementation of the “bi” option is very simple to understand, the best way to illustrate how to use it is by example. So below I coded one that shows how to request in one go the italic and bold versions of the “Cantarell” typeface by using this shorthand:
There you have it. Simply by appending the suffix “bi” to the name of the specified font will effectively download its bold and italicized versions. Once the request has been successfully processed, the font(s) can be used in a standard fashion, as shown below:
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've grasped the logic behind using the "bi" shorthand, we'll include the previous CSS styles into an (X)HTML document, so you can have at your disposal a working example that will let you see the actual functionality of this shorthand.
This final process will be accomplished in the next section of this tutorial, so leap forward and keep reading.