Introduction to the google font API

Introduction to the google font API

Great news geeks!

google has released the font api for webdevelopers. By using this api you can use different font then the standard fonts. Which means, you can make your future website more beautifull and stylish.

How can I do this?

Calling the API is done by assigning a href to the style attribute in your HTML. As shown below:

Next, you declare the font in your css selector, if you like to use the custom font in your whole document you declare it like this:

 body {
        font-family: 'Nobile', serif;
        font-size: 48px;
      }

If you want to specify a font for a certain div, you create a div and link this to the font like this:

Inside your css file:

#differentFont{
        font-family: 'Nobile', serif;
        font-size: 18px;
      }

inside your html file:

the full html page would look something like this:

Can I use every free font?
Google has collected several fonts in a list which can be found right over here. In the future this list will be updated.

I really hope you’ve learned something reading this article.

Lode

About the Author

Lode is a Creative-Geek with passion for Graphic design , he is also into the web programming "stuff" like Adobe Flash,air and Flex . Lode loves to learn and loves to share knowledge with others.Follow Lode on http://twitter.com/stealfish