Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Carver committed May 18, 2010
1 parent fb414a4 commit 38754d2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
24 changes: 15 additions & 9 deletions README.md
Expand Up @@ -5,12 +5,15 @@ WebFont Loader gives you added control when using linked fonts via
the source, then adds a standard set of events you may use to control the the source, then adds a standard set of events you may use to control the
loading experience. loading experience.



## Get Started ## Get Started


(These samples use WebFont Loader hosted on [Google's AJAX APIs][gajax].)

Link to the WebFont Loader library, then tell it which fonts to load. Here we'll Link to the WebFont Loader library, then tell it which fonts to load. Here we'll
load fonts from Google. load fonts from [Google's Font API][gfontapi].


<script src="http://ajax.googleapis.com/ajax/libs/webfont/1.0.0/webfont.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
<script> <script>
WebFont.load({ WebFont.load({
google: { google: {
Expand All @@ -21,7 +24,7 @@ load fonts from Google.


Alternatively, load fonts from Typekit. Just specify your Kit ID. Alternatively, load fonts from Typekit. Just specify your Kit ID.


<script src="http://ajax.googleapis.com/ajax/libs/webfont/1.0.0/webfont.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
<script> <script>
WebFont.load({ WebFont.load({
typekit: { typekit: {
Expand All @@ -40,10 +43,11 @@ WebFont Loader gives you control over how fonts are loaded. If you're
frustrated by the "flash of unstyled text" typically seen in FireFox, try frustrated by the "flash of unstyled text" typically seen in FireFox, try
this. this.


<script src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
<script> <script>
WebFont.load({ WebFont.load({
google: { google: {
family: ['Droid Sans'] families: ['Droid Sans']
} }
}); });
</script> </script>
Expand Down Expand Up @@ -98,8 +102,10 @@ Browse the demos [source code][demos].
WebFont Loader is released under the [Apache 2.0][lic] license. WebFont Loader is released under the [Apache 2.0][lic] license.




[mod]: http://github.com/typekit/webfontjs/blob/master/docs/MODULES.md [mod]: http://github.com/typekit/webfontloader/blob/master/docs/MODULES.md
[trn]: http://github.com/typekit/webfontjs/blob/master/docs/TRANSITIONS.md [trn]: http://github.com/typekit/webfontloader/blob/master/docs/TRANSITIONS.md
[evt]: http://github.com/typekit/webfontjs/blob/master/docs/EVENTS.md [evt]: http://github.com/typekit/webfontloader/blob/master/docs/EVENTS.md
[lic]: http://github.com/typekit/webfontjs/blob/master/LICENSE [lic]: http://github.com/typekit/webfontloader/blob/master/LICENSE
[demos]: http://github.com/typekit/webfontjs/blob/master/lib/webfontjs/demo/public [demos]: http://github.com/typekit/webfontloader/blob/master/lib/webfontloader/demo/public
[gfontapi]: https://code.google.com/apis/webfonts/
[gajax]: http://code.google.com/apis/ajax/
16 changes: 12 additions & 4 deletions docs/MODULES.md
Expand Up @@ -3,16 +3,19 @@
WebFont Loader provides a generic module system so that any web font provider WebFont Loader provides a generic module system so that any web font provider
may be used. The specifics of each provider are documented here. may be used. The specifics of each provider are documented here.



## Google ## Google


Using Google's Font API, name the font families you'd like to load. Using Google's Font API, name the font families you'd like to load.


WebFont.load({ WebFont.load({
google: { google: {
family: ['Droid Sans', 'Droid Serif'] families: ['Droid Sans', 'Droid Serif']
} }
}); });


Learn more about the [Google Font API][gfontapi].



## Typekit ## Typekit


Expand All @@ -25,11 +28,13 @@ ID within Typekit's Kit Editor interface.
} }
}); });



Learn more about [Typekit][tk].


## Custom ## Custom


To load fonts from any external stylesheet, use the `custom` module. Here you'll To load fonts from any external stylesheet, use the `custom` module. Here you'll
need to specify both the url of the stylesheet as well as the font families it need to specify both the url of the stylesheet as well as the font families it
provides. provides.


WebFont.load({ WebFont.load({
Expand All @@ -38,4 +43,7 @@ provides.
urls: ['/fonts.css'] urls: ['/fonts.css']
} }
}); });



[gfontapi]: https://code.google.com/apis/webfonts/docs/getting_started.html
[tk]: http://typekit.com/
4 changes: 2 additions & 2 deletions docs/TRANSITIONS.md
Expand Up @@ -19,7 +19,7 @@ You can get started with web fonts quickly and easily by just using Google.
<script type="text/javascript"> <script type="text/javascript">
WebFont.load({ WebFont.load({
google: { google: {
family: ['Droid Sans'] families: ['Droid Sans']
} }
}); });
</script> </script>
Expand All @@ -35,7 +35,7 @@ to add fonts from Typekit.
<script type="text/javascript"> <script type="text/javascript">
WebFont.load({ WebFont.load({
google: { google: {
family: ['Droid Sans'] families: ['Droid Sans']
}, },
typekit: { typekit: {
id: 'abc1def' id: 'abc1def'
Expand Down

0 comments on commit 38754d2

Please sign in to comment.