Using custom fonts in blogger using new google font API

Everybody wants that their website look better.With the introduction of web 2.0 the web goes more visually attractive.One of this advance technique is to use custom fonts with their web page. CSS provides @font-face technique to replace the boring traditional fonts and limitation to user fonts.

But the problem is using @font-face we would need to find reliable hosting for the fonts we use in our designs that enables us to utilize fonts across with no domain-restrictive policies in place. There are also permission and copyright issues involved with embedding fonts in web pages, making the whole process even more complicated.


So what is the way out

Fortunately there are some free service (like kernest) that let us embed custom fonts for our website.Google has also entered in the service with Google font API.We will discuss how to use Google API because it's reliable,easy and free,requires no registration.

Using Google Font API

Browse font in google font directory.

  1. Click on 'click to embed font_name' on the top right.
  2. Click on get the code, and copy the code.

Look in the pictures below

1.embed the font
1.embed the font
2.Get the code
2.Get the code

It is time to change the font in your blogger blog .

Go to Design>Edit HTML in your Blogger dashboard and find </head>tag. Paste the code you have copied.After pasting end the pasted code like this

...type='text/css'/>   (not shown in picture)The slash is important    

 

paste the code in blogger
paste the code in blogger

Now apply this font to the section you want.Suppose you want to apply the font for h2 tags,so the code will be like this,before

</b:skin>, add 
h1 { font-family: 'Tangerine', arial, serif; }

You can also edit the element,you need to find the right css selector.

 

Just add the new font name in the beginning.

Now one thing to remember the font you embed is only regular font.

Follow the API instruction to add a bold,italic or bold-italic font, a simple example will be like this, to request Cantarell font in italic

 

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

To request multiple fonts,separate the names with a pipe character (|), and spaces by a plus (+)



<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine|Inconsolata|Droid+Sans">

There are many other advanced technique for this web fonts.All are available in the API documentation. Don't be upset with such small library of fonts,it will increased definitely,also advanced user can try google webfont loader to request free font from typekit.Look here for further info.

And the last word, this tutorial is for blogger though you can use it with any web page, not the hub-page it will cleanup when you try to update html editor. :(


More by this Author


Comments 1 comment

agvulpes profile image

agvulpes 6 years ago from Australia

This is great information I wanted to do this just last week and could not find out how. Im bookmarking this Hub and Thumbs up !

Thanks very much:-) and you have a new Fan!

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working