Home arrow HTML arrow Page 3 - Google Font API: Requesting a Bold Font Style Using a Numeric Notation
HTML

Google Font API: Requesting a Bold Font Style Using a Numeric Notation


If you’re a web designer who wants to take full advantage of the functionality offered by the brand new web service implemented by Google, that is the already popular Font API, then this article series might be the material that you’re looking for. It shows you how to work with the API’s most relevant features. In this ninth (and final) article of the series, you'll learn another way to get the bold version of a font.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 5
July 07, 2010
TABLE OF CONTENTS:
  1. · Google Font API: Requesting a Bold Font Style Using a Numeric Notation
  2. · Review: the shorthand bi
  3. · Downloading a bold font style via a numeric notation
  4. · Embedding the previous CSS styles into a web page

print this article
SEARCH DEVARTICLES

Google Font API: Requesting a Bold Font Style Using a Numeric Notation - Downloading a bold font style via a numeric notation
(Page 3 of 4 )

While it’s much more intuitive and readable to request the bold style of a font family by using the “bold” keyword or its shorthand “b,” the API will let you perform the same task by passing a number in the query string. If you’re wondering how this can be achieved, I suggest that you look at the following code fragment, which hopefully will dissipate all of your doubts: 

<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Cantarell:700|Nobile" />

Well, that’s not too complex to understand, right? In this case, the bold style of the “Cantarell” typeface has been downloaded by appending to the font’s name the value 700, separated by the corresponding colon. Once the request has been successfully processed, the font in question can be used in the regular way, as demonstrated by the following code snippet:

 

h1 {

    font: normal 46px 'Cantarell', Helvetica, sans-serif;

    color: #00f;  

}

h2 {

    font: normal 40px 'Cantarell', Helvetica, sans-serif;

    color: #ff8040;  

}

h3 {

    font: normal 32px 'Cantarell', Helvetica, sans-serif;

    color: #ff8040;

}

p {

    font: normal 14px 'Nobile', Helvetica, serif;

}

See how easy it is to use bold font styles with a numeric notation? I guess you do. Needless to say, in their current state the earlier CSS styles do nothing especially useful, since they must be included into a web page to work. That’s exactly what I plan to do in the following segment, so click on the link that appears below and keep reading. 


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials