webfontloader 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +4 -0
- data/CHANGELOG +3 -0
- data/README.md +246 -101
- data/lib/webfontloader.rb +1 -1
- data/lib/webfontloader/demo/public/index.html +18 -18
- data/spec/core/useragentparser_spec.js +6 -6
- data/spec/core/webfont_spec.js +29 -4
- data/spec/monotype/monotypescript_spec.js +15 -2
- data/src/core/useragent.js +53 -5
- data/src/core/useragentparser.js +121 -28
- data/webfontloader.gemspec +3 -5
- metadata +5 -10
- data/docs/EVENTS.md +0 -169
- data/docs/MODULES.md +0 -96
- data/docs/TRANSITIONS.md +0 -142
data/AUTHORS
ADDED
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -1,18 +1,30 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
# Web Font Loader
|
2
|
+
|
3
|
+
Web Font Loader gives you added control when using linked fonts via `@font-face`. It provides a common interface to loading fonts regardless of the source, then adds a standard set of events you may use to control the loading experience. The Web Font Loader is able to load fonts from [Google Fonts](http://www.google.com/fonts/), [Typekit](http://www.typekit.com/), [Ascender](http://www.ascenderfonts.com/webfonts/), [Fonts.com](http://www.fonts.com/), and [Fontdeck](http://fontdeck.com/), as well as self-hosted web fonts. It is co-developed by [Google](http://www.google.com/) and [Typekit](http://www.typekit.com).
|
4
|
+
|
5
|
+
## Contents
|
6
|
+
|
7
|
+
* [Get started](#get-started)
|
8
|
+
* [Configuration](#configuration)
|
9
|
+
* [Events](#events)
|
10
|
+
* [Timeout](#timeout)
|
11
|
+
* [Iframes](#iframes)
|
12
|
+
* [Modules](#modules)
|
13
|
+
* [Ascender](#ascender)
|
14
|
+
* [Custom](#custom)
|
15
|
+
* [Fontdeck](#fontdeck)
|
16
|
+
* [Fonts.com](#fonts.com)
|
17
|
+
* [Google](#google)
|
18
|
+
* [Typekit](#typekit)
|
19
|
+
* [Browser support](#browser-support)
|
20
|
+
* [Contributing](#contributing)
|
21
|
+
* [License](#license)
|
7
22
|
|
8
23
|
## Get Started
|
9
24
|
|
10
|
-
(
|
11
|
-
|
12
|
-
Link to the WebFont Loader library, then tell it which fonts to load. Here we'll
|
13
|
-
load fonts from [Google's Font API][gfontapi].
|
25
|
+
To use the Web Font Loader library, just include it in your page and tell it which fonts to load. For example, you could load fonts from [Google Fonts](http://www.google.com/fonts/) using the Web Font Loader hosted on [Google Hosted Libraries](https://developers.google.com/speed/libraries/) using the following code.
|
14
26
|
|
15
|
-
<script src="
|
27
|
+
<script src="//ajax.googleapis.com/ajax/libs/webfont/1.4.2/webfont.js"></script>
|
16
28
|
<script>
|
17
29
|
WebFont.load({
|
18
30
|
google: {
|
@@ -21,84 +33,246 @@ load fonts from [Google's Font API][gfontapi].
|
|
21
33
|
});
|
22
34
|
</script>
|
23
35
|
|
24
|
-
Alternatively, load
|
36
|
+
Alternatively, you can link to the latest `1.x` version of the Web Font Loader by using `//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js` as the `script` source. Note that the version in this url is less specific. It will always load the latest `1.x` version, but it also has a shorter cache time to ensure that your page gets updates in a timely manner. For performance reasons, we recommend using an explicit version number (such as `1.4.2`) in urls when using the Web Font Loader in production. You can manually update the Web Font Loader version number in the url when you want to adopt a new version.
|
37
|
+
|
38
|
+
It is also possible to use the Web Font Loader asynchronously. For example, to load [Typekit](http://www.typekit.com) fonts asynchronously, you could use the following code.
|
25
39
|
|
26
|
-
<script src="http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
|
27
40
|
<script>
|
28
|
-
|
29
|
-
typekit: {
|
30
|
-
|
31
|
-
|
32
|
-
|
41
|
+
WebFontConfig = {
|
42
|
+
typekit: { id: 'xxxxxx' }
|
43
|
+
};
|
44
|
+
|
45
|
+
(function() {
|
46
|
+
var wf = document.createElement('script');
|
47
|
+
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
|
48
|
+
'://ajax.googleapis.com/ajax/libs/webfont/1.4.2/webfont.js';
|
49
|
+
wf.type = 'text/javascript';
|
50
|
+
wf.async = 'true';
|
51
|
+
var s = document.getElementsByTagName('script')[0];
|
52
|
+
s.parentNode.insertBefore(wf, s);
|
53
|
+
})();
|
33
54
|
</script>
|
34
55
|
|
35
|
-
|
36
|
-
[modules][mod].
|
56
|
+
Using the Web Font Loader asynchronously avoids blocking your page while loading the JavaScript. Be aware that if the script is used asynchronously, the rest of the page might render before the Web Font Loader is loaded and executed, which can cause a [Flash of Unstyled Text (FOUT)](http://help.typekit.com/customer/portal/articles/6852).
|
37
57
|
|
38
|
-
|
58
|
+
The FOUT can be more easily avoided when loading the Web Font Loader synchronously, as it will automatically set the `wf-loading` class on the HTML element as soon as `Webfont.load` has been called. The browser will wait for the script to load before continuing to load the rest of the content, FOUT is avoided.
|
39
59
|
|
40
|
-
|
41
|
-
frustrated by the "flash of unstyled text" typically seen in FireFox, try
|
42
|
-
this.
|
60
|
+
## Configuration
|
43
61
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
62
|
+
The Web Font Loader configuration is defined by a global variable named `WebFontConfig`, or passed directly to the `WebFont.load` method. It defines which fonts to load from each web font provider and gives you the option to specify callbacks for certain events. When using the asynchronous approach, you must define the global variable `WebFontConfig` before the code that loads the Web Font Loader (as in the example above).
|
63
|
+
|
64
|
+
### Events
|
65
|
+
|
66
|
+
Web Font Loader provides an event system that developers can hook into. It gives you notifications of the font loading sequence in both CSS and JavaScript.
|
67
|
+
|
68
|
+
* `loading` - This event is triggered when all fonts have been requested.
|
69
|
+
* `active` - This event is triggered when the fonts have rendered.
|
70
|
+
* `inactive` - This event is triggered when the browser does not support linked fonts *or* if none of the fonts could be loaded.
|
71
|
+
* `fontloading` - This event is triggered once for each font that's loaded.
|
72
|
+
* `fontactive` - This event is triggered once for each font that renders.
|
73
|
+
* `fontinactive` - This event is triggered if the font can't be loaded.
|
74
|
+
|
75
|
+
CSS events are implemented as classes on the `html` element. The following classes are set on the `html` element:
|
76
|
+
|
77
|
+
.wf-loading
|
78
|
+
.wf-active
|
79
|
+
.wf-inactive
|
80
|
+
.wf-<familyname>-<fvd>-loading
|
81
|
+
.wf-<familyname>-<fvd>-active
|
82
|
+
.wf-<familyname>-<fvd>-inactive
|
83
|
+
|
84
|
+
The `<familyname>` placeholder will be replaced by a sanitized version of the name of each font family. Spaces and underscores are removed from the name, and all characters are converted to lower case. For example, `Droid Sans` becomes `droidsans`. The `<fvd>` placeholder is a [Font Variation Description](https://github.com/typekit/fvd). Put simply, it's a shorthand for describing the style and weight of a particular font. Here are a few examples:
|
85
|
+
|
86
|
+
/* n4 */
|
87
|
+
@font-face { font-style: normal; font-weight: normal; }
|
88
|
+
|
89
|
+
/* i7 */
|
90
|
+
@font-face { font-style: italic; font-weight: bold; }
|
91
|
+
|
92
|
+
Keep in mind that `font-weight: normal` maps to `font-weight: 400` and `font-weight: bold` maps to `font-weight: 700`. If no style/weight is specified, the default `n4` (`font-style: normal; font-weight: normal;`) will be used.
|
93
|
+
|
94
|
+
If fonts are loaded multiple times on a single page, the CSS classes continue to update to reflect the current state of the page. The global `wf-loading` class is applied whenever fonts are being requested (even if other fonts are already active or inactive). The `wf-inactive` class is applied only if none of the fonts on the page have rendered. Otherwise, the `wf-active` class is applied (even if some fonts are inactive).
|
95
|
+
|
96
|
+
JavaScript events are implemented as callback functions on the `WebFontConfig` configuration object.
|
97
|
+
|
98
|
+
WebFontConfig = {
|
99
|
+
loading: function() {},
|
100
|
+
active: function() {},
|
101
|
+
inactive: function() {},
|
102
|
+
fontloading: function(familyName, fvd) {},
|
103
|
+
fontactive: function(familyName, fvd) {},
|
104
|
+
fontinactive: function(familyName, fvd) {}
|
105
|
+
};
|
106
|
+
|
107
|
+
The `fontloading`, `fontactive` and `fontinactive` callbacks are passed the family name and font variation description of the font that concerns the event.
|
108
|
+
|
109
|
+
### Timeouts
|
110
|
+
|
111
|
+
Since the Internet is not 100% reliable, it's possible that a font will fail to load. The `fontinactive` event will be triggered after 5 seconds if the font fails to render. If *at least* one font succesfully renders, the `active` event will be triggered, else the `inactive` even will be triggered.
|
112
|
+
|
113
|
+
You can change the default timeout by using the `timeout` option on the `WebFontConfig` object.
|
114
|
+
|
115
|
+
WebFontConfig = {
|
116
|
+
google: {
|
117
|
+
families: ['Droid Sans']
|
118
|
+
},
|
119
|
+
timeout: 2000 // Set the timeout to two seconds
|
120
|
+
};
|
121
|
+
|
122
|
+
The timeout value should be in milliseconds, and defaults to 5000 milliseconds (5 seconds) if not supplied.
|
123
|
+
|
124
|
+
### Iframes
|
125
|
+
|
126
|
+
Usually, it's easiest to include a copy of Web Font Loader in every window where fonts are needed, so that each window manages its own fonts. However, if you need to have a single window manage fonts for multiple same-origin child windows or iframes that are built up using JavaScript, Web Font Loader supports that as well. Just use the optional `context` configuration option and give it a reference to the target window for loading:
|
127
|
+
|
128
|
+
WebFontConfig = {
|
129
|
+
google: {
|
130
|
+
families: ['Droid Sans']
|
131
|
+
},
|
132
|
+
context: frames['my-child']
|
133
|
+
};
|
134
|
+
|
135
|
+
This is an advanced configuration option that isn't needed for most use cases.
|
136
|
+
|
137
|
+
## Modules
|
138
|
+
|
139
|
+
Web Font Loader provides a module system so that any web font provider can contribute code that allows their fonts to be loaded. This makes it possible to use multiple web font providers at the same time. The specifics of each provider currently supported by the library are documented here.
|
140
|
+
|
141
|
+
### Ascender
|
142
|
+
|
143
|
+
To load fonts from the FontsLive service use the `ascender` module.
|
144
|
+
|
145
|
+
WebFontConfig = {
|
146
|
+
ascender: {
|
147
|
+
key: 'myAscenderKey',
|
148
|
+
families: [ 'AscenderSans:bold,bolditalic,italic,regular' ]
|
56
149
|
}
|
57
|
-
|
58
|
-
|
150
|
+
};
|
151
|
+
|
152
|
+
**NOTE**: The Ascender font service has been acquired by Monotype (Fonts.com) and as such the use of the Fonts.com module is recommended.
|
153
|
+
|
154
|
+
### Custom
|
155
|
+
|
156
|
+
To load fonts from any external stylesheet, use the `custom` module. Here you'll
|
157
|
+
need to specify both the url of the stylesheet as well as the font families it
|
158
|
+
provides.
|
159
|
+
|
160
|
+
You can specify a specific font variation or set of variations to load and watch
|
161
|
+
by appending the variations separated by commas to the family name separated by
|
162
|
+
a colon. Variations are specified using [FVD notation](https://github.com/typekit/fvd).
|
163
|
+
|
164
|
+
WebFontConfig = {
|
165
|
+
custom: {
|
166
|
+
families: ['My Font', 'My Other Font:n4,i4,n7'],
|
167
|
+
urls: ['/fonts.css']
|
59
168
|
}
|
60
|
-
|
169
|
+
};
|
170
|
+
|
171
|
+
In this example, the `fonts.css` file might look something like this:
|
172
|
+
|
173
|
+
@font-face {
|
174
|
+
font-family: 'My Font';
|
175
|
+
src: ...;
|
176
|
+
}
|
177
|
+
@font-face {
|
178
|
+
font-family: 'My Other Font';
|
179
|
+
font-style: normal;
|
180
|
+
font-weight: normal; /* or 400 */
|
181
|
+
src: ...;
|
182
|
+
}
|
183
|
+
@font-face {
|
184
|
+
font-family: 'My Other Font';
|
185
|
+
font-style: italic;
|
186
|
+
font-weight: normal; /* or 400 */
|
187
|
+
src: ...;
|
188
|
+
}
|
189
|
+
@font-face {
|
190
|
+
font-family: 'My Other Font';
|
191
|
+
font-style: normal;
|
192
|
+
font-weight: bold; /* or 700 */
|
193
|
+
src: ...;
|
194
|
+
}
|
195
|
+
|
196
|
+
### Fontdeck
|
197
|
+
|
198
|
+
To use the [Fontdeck](http://fontdeck.com/) module, specify the ID of your website. You can find this ID on the website page within your account settings.
|
199
|
+
|
200
|
+
WebFontConfig = {
|
201
|
+
fontdeck: {
|
202
|
+
id: 'xxxxx'
|
203
|
+
}
|
204
|
+
};
|
61
205
|
|
62
|
-
|
63
|
-
<h1>This headline will be hidden until Droid Sans is completely loaded.</h1>
|
64
|
-
</body>
|
206
|
+
### Fonts.com
|
65
207
|
|
66
|
-
|
208
|
+
When using [Fonts.com web fonts](http://webfonts.fonts.com/) specify your Project ID.
|
67
209
|
|
68
|
-
|
210
|
+
WebFontConfig = {
|
211
|
+
monotype: {
|
212
|
+
projectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
213
|
+
version: 12345 // (optional, flushes the CDN cache)
|
214
|
+
}
|
215
|
+
};
|
69
216
|
|
70
|
-
|
71
|
-
fonts are needed, so that each window manages its own fonts. However, if you
|
72
|
-
need to have a single window manage fonts for multiple same-origin child windows
|
73
|
-
or iframes that are built up using JavaScript, webfontloader supports that as
|
74
|
-
well. Just use the optional `context` configuration option and give it a
|
75
|
-
reference to the target window for loading:
|
217
|
+
The Fonts.com module has an optional `version` option which acts as a cache-buster.
|
76
218
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
219
|
+
### Google
|
220
|
+
|
221
|
+
Using [Google's Font API](https://code.google.com/apis/webfonts/docs/getting_started.html), name the font families you'd like to load.
|
222
|
+
|
223
|
+
WebFontConfig = {
|
224
|
+
google: {
|
225
|
+
families: ['Droid Sans', 'Droid Serif']
|
226
|
+
}
|
227
|
+
};
|
228
|
+
|
229
|
+
You can also supply the `text` parameter to perform character subsetting:
|
230
|
+
|
231
|
+
WebFontConfig = {
|
232
|
+
google: {
|
233
|
+
families: ['Droid Sans', 'Droid Serif'],
|
234
|
+
text: 'abcdedfghijklmopqrstuvwxyz!'
|
235
|
+
}
|
236
|
+
};
|
237
|
+
|
238
|
+
The `text` subsetting functionality is only available for the Google module.
|
85
239
|
|
86
|
-
|
240
|
+
### Typekit
|
87
241
|
|
88
|
-
|
89
|
-
works with Google, Typekit, Ascender, Fontdeck, Fonts.com Web fonts and your own
|
90
|
-
CSS. Learn more in [transitions][trn].
|
242
|
+
When using [Typekit](http://www.typekit.com), specify the Kit to retrieve by its ID. You can find the Kit ID within Typekit's Kit Editor interface.
|
91
243
|
|
92
|
-
|
244
|
+
WebFontConfig = {
|
245
|
+
typekit: {
|
246
|
+
id: 'xxxxxx'
|
247
|
+
}
|
248
|
+
};
|
249
|
+
|
250
|
+
**FYI:** Typekit's own JavaScript is built using the Web Font Loader library and already provides all of the same font event functionality. If you're using Typekit, you should use their embed codes directly unless you also need to load web fonts from other providers on the same page.
|
251
|
+
|
252
|
+
## Browser Support
|
253
|
+
|
254
|
+
Every web browser has varying levels of support for fonts linked via `@font-face`. Web Font Loader determines support for web fonts is using the browser's user agent string. The user agent string may claim to support a web font format when it in fact does not. This is especially noticeable on mobile browsers with a "Desktop" mode, which usually identify as Chrome on Linux. In this case a web font provider may decide to send WOFF fonts to the device because the real desktop Chrome supports it, while the mobile browser does not. The Web Font Loader is not designed to handle these cases and it defaults to believing what's in the user agent string. Web font providers can build on top of the basic Web Font Loader functionality to handle these special cases individually.
|
255
|
+
|
256
|
+
If Web Font Loader determines that the current browser does not support `@font-face`, the `inactive` event will be triggered.
|
93
257
|
|
94
|
-
|
258
|
+
When loading fonts from multiple providers, each provider may or may not support a given browser. If Web Font Loader determines that the current browser can support `@font-face`, and *at least* one provider is able to serve fonts, the fonts from that provider will be loaded. When finished, the `active` event will be triggered.
|
95
259
|
|
96
|
-
|
260
|
+
For fonts loaded from supported providers, the `fontactive` event will be triggered. For fonts loaded from a provider that *does not* support the current browser, the `fontinactive` event will be triggered.
|
261
|
+
|
262
|
+
For example:
|
263
|
+
|
264
|
+
WebFontConfig = {
|
265
|
+
providerA: 'Family1',
|
266
|
+
providerB: 'Family2'
|
267
|
+
};
|
268
|
+
|
269
|
+
If `providerA` can serve fonts to a browser, but `providerB` cannot, The `fontinactive` event will be triggered for `Family2`. The `fontactive` event will be triggered for `Family1` once it loads, as will the `active` event.
|
270
|
+
|
271
|
+
## Contributing
|
97
272
|
|
98
|
-
|
99
|
-
to fix it?
|
273
|
+
Please open [an issue](https://github.com/typekit/webfontloader/issues) if you find or suspect any problems. Sample pages and test cases are greatly appreciated.
|
100
274
|
|
101
|
-
###
|
275
|
+
### Development requirements
|
102
276
|
|
103
277
|
You'll need a few rubygems to run the tests, demo server, and other rake tasks, which should be installed with [Bundler](http://gembundler.com/).
|
104
278
|
|
@@ -127,13 +301,12 @@ development. Just start the server in dev mode:
|
|
127
301
|
|
128
302
|
$ rake demodev
|
129
303
|
|
130
|
-
Browse the demos [source code]
|
304
|
+
Browse the demos [source code](http://github.com/typekit/webfontloader/blob/master/lib/webfontloader/demo/public).
|
131
305
|
|
132
306
|
### Testing
|
133
307
|
|
134
|
-
|
135
|
-
should be passing before submitting a pull request, and new tests should be added
|
136
|
-
for any new functionality.
|
308
|
+
Web Font Loader has an extensive test suite that runs via Jasmine. The test suite
|
309
|
+
should be passing before submitting a pull request, and new tests should be added for any new functionality.
|
137
310
|
|
138
311
|
To run tests, open up `spec/index.html` in a browser and check the results. The
|
139
312
|
test suite will run automatically. Again, before submitting a pull request
|
@@ -143,34 +316,6 @@ To run tests in a headless WebKit using [PhantomJS](http://www.phantomjs.org) ru
|
|
143
316
|
|
144
317
|
$ rake test
|
145
318
|
|
146
|
-
## Contributing
|
147
|
-
|
148
|
-
* Fork webfontloader
|
149
|
-
* Create a topic branch - `git checkout -b my_branch`
|
150
|
-
* Push to your branch - `git push origin my_branch`
|
151
|
-
* Make sure all tests are passing
|
152
|
-
* Create a pull request for your branch
|
153
|
-
* That's it!
|
154
|
-
|
155
|
-
|
156
|
-
## Authors
|
157
|
-
|
158
|
-
* Ryan Carver / ryan@typekit.com
|
159
|
-
* Jeremie Lenfant-engelmann / jeremiele@google.com
|
160
|
-
* Sean McBride / sean@typekit.com
|
161
|
-
* Bram Stein / bram@typekit.com
|
162
|
-
|
163
|
-
|
164
319
|
## License
|
165
320
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
[mod]: http://github.com/typekit/webfontloader/blob/master/docs/MODULES.md
|
170
|
-
[trn]: http://github.com/typekit/webfontloader/blob/master/docs/TRANSITIONS.md
|
171
|
-
[evt]: http://github.com/typekit/webfontloader/blob/master/docs/EVENTS.md
|
172
|
-
[lic]: http://github.com/typekit/webfontloader/blob/master/LICENSE
|
173
|
-
[demos]: http://github.com/typekit/webfontloader/blob/master/lib/webfontloader/demo/public
|
174
|
-
[gfontapi]: https://developers.google.com/fonts/
|
175
|
-
[gajax]: https://developers.google.com/speed/libraries/
|
176
|
-
[issues]: https://github.com/typekit/webfontloader/issues
|
321
|
+
Web Font Loader is released under the [Apache 2.0](http://github.com/typekit/webfontloader/blob/master/LICENSE) license.
|
data/lib/webfontloader.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
</head>
|
5
5
|
<body>
|
6
|
-
<h1>
|
6
|
+
<h1>Web Font Loader Demos</h1>
|
7
7
|
<p>
|
8
8
|
Demonstrations of pure CSS and JavaScript-enhanced use of @font-face.
|
9
9
|
</p>
|
@@ -16,34 +16,34 @@
|
|
16
16
|
|
17
17
|
<h2>Modules</h2>
|
18
18
|
<p>
|
19
|
-
|
19
|
+
Web Font Loader provides modules to load fonts from many places.
|
20
20
|
</p>
|
21
21
|
<ol>
|
22
22
|
<li><a href="/google-css.html">Google / CSS Link</a>: Load fonts from Google with a <code>link</code> tag. Consider this a base case for font loading.</li>
|
23
|
-
<li><a href="/google.html">Google /
|
24
|
-
<li><a href="/typekit.html">Typekit /
|
25
|
-
<li><a href="/custom.html">Custom /
|
26
|
-
<li><a href="/ascender.html">Ascender /
|
27
|
-
<li><a href="/fontdeck.html">Fontdeck /
|
28
|
-
<li><a href="/monotype.html">Monotype /
|
23
|
+
<li><a href="/google.html">Google / Web Font Loader</a>: Load fonts from Google with Web Font Loader.</li>
|
24
|
+
<li><a href="/typekit.html">Typekit / Web Font Loader</a>: Load fonts from Typekit with Web Font Loader.</li>
|
25
|
+
<li><a href="/custom.html">Custom / Web Font Loader</a>: Load fonts from your own CSS with Web Font Loader.</li>
|
26
|
+
<li><a href="/ascender.html">Ascender / Web Font Loader</a>: Load fonts from Ascender with Web Font Loader.</li>
|
27
|
+
<li><a href="/fontdeck.html">Fontdeck / Web Font Loader</a>: Load fonts from Fontdeck with Web Font Loader.</li>
|
28
|
+
<li><a href="/monotype.html">Monotype / Web Font Loader</a>: Load fonts from webfonts.fonts.com with Web Font Loader.</li>
|
29
29
|
</ol>
|
30
30
|
|
31
31
|
<h2>Modules in Iframes</h2>
|
32
32
|
<p>
|
33
|
-
|
33
|
+
Web Font Loader provides the ability to load fonts in child iframes using modules, instead of the main window.
|
34
34
|
</p>
|
35
35
|
<ol>
|
36
|
-
<li><a href="/google-iframe.html">Google /
|
37
|
-
<li><a href="/typekit-iframe.html">Typekit /
|
38
|
-
<li><a href="/custom-iframe.html">Custom /
|
39
|
-
<li><a href="/ascender-iframe.html">Ascender /
|
40
|
-
<li>Fontdeck /
|
41
|
-
<li><a href="/monotype-iframe.html">Monotype /
|
36
|
+
<li><a href="/google-iframe.html">Google / Web Font Loader</a>: Load fonts from Google in a child iframe with Web Font Loader.</li>
|
37
|
+
<li><a href="/typekit-iframe.html">Typekit / Web Font Loader</a>: Load fonts from Typekit in a child iframe with Web Font Loader.</li>
|
38
|
+
<li><a href="/custom-iframe.html">Custom / Web Font Loader</a>: Load fonts from your own CSS in a child iframe with Web Font Loader.</li>
|
39
|
+
<li><a href="/ascender-iframe.html">Ascender / Web Font Loader</a>: Load fonts from Ascender in a child iframe with Web Font Loader.</li>
|
40
|
+
<li>Fontdeck / Web Font Loader: Their demo fonts seem to be broken at the moment, so we don't have an iframe demo of this module.</li>
|
41
|
+
<li><a href="/monotype-iframe.html">Monotype / Web Font Loader</a>: Load fonts from webfonts.fonts.com in a child iframe with Web Font Loader.</li>
|
42
42
|
</ol>
|
43
43
|
|
44
44
|
<h2>Events</h2>
|
45
45
|
<p>
|
46
|
-
|
46
|
+
Web Font Loader provides events to help control font rendering across browsers. Here are some sample uses.
|
47
47
|
</p>
|
48
48
|
<ol>
|
49
49
|
<li><a href="/event-css-active.html">Show when rendered (CSS)</a>: Use CSS to show part of the page only when the font has rendered. (Webkit style)</li>
|
@@ -65,11 +65,11 @@
|
|
65
65
|
|
66
66
|
<h2>IE Behavior</h2>
|
67
67
|
<p>
|
68
|
-
|
68
|
+
Web Font Loader helps workaround IE's page blocking behavior.
|
69
69
|
</p>
|
70
70
|
<ol>
|
71
71
|
<li><a href="/ie-slow-link.html">Slow Link</a>: Demonstrate that IE blocks the whole page when loading fonts via a LINK tag.</li>
|
72
|
-
<li><a href="/ie-fast-js.html">Fast JS</a>: By default,
|
72
|
+
<li><a href="/ie-fast-js.html">Fast JS</a>: By default, Web Font Loader works around the default IE loading behavior.</li>
|
73
73
|
<li><a href="/ie-slow-js.html">Slow JS</a>: Restore the default IE loading behavior.</li>
|
74
74
|
</ol>
|
75
75
|
|