Webfont Loader

The WebFont Loader is a JavaScript library that lets you easily link webfonts of several webfonts services like Typekit and the Google Font Directory. It also deals with certain problems like the "Flash of Unstyled Text" in Firefox.

The following example first displays the text in the default serif font; then after the fonts have loaded it displays the text in the specified font. (This code reproduces Firefox's default behavior in all other modern browsers.)

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js">
   </script>
   <script type="text/javascript">
     WebFont.load({
       google: {
         families: [ 'Tangerine', 'Cantarell' ]
       }<
     });
   </script>
   <style type="text/css">
     .wf-inactive p {
       font-family: serif
     }
     .wf-active p {
       font-family: 'Tangerine', serif
     }
     .wf-inactive h1 {
       font-family: serif;
       font-size: 16px
     }
     .wf-active h1 {
       font-family: 'Cantarell', serif;
       font-size: 16px
     }
   </style>

For more information see: http://code.google.com/intl/de/apis/webfonts/docs/webfont_loader.html