webfont-loader

1.1.0 • Public • Published

webfont-loader npm version

Load webfont using native FontFace with fall back to font-face-observer (see web font loading detection, without timers for details on how the fallback works).

Assumptions:

  • have font in WOFF format
  • font src is a HTTP or HTTPS URL

Example

var webFontLoader = require('webfont-loader');
 
webFontLoader('My Font Family', {src: ['http://some.cdn.example.com/my_font.woff']}).then(
  function fontLoaded() {
    // ...
  },
  function fontFailedToLoad() {
    // ...
  }
);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.042latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.042
1.0.03
0.1.03
0.0.113
0.0.103
0.0.83
0.0.73
0.0.63
0.0.53
0.0.43
0.0.33
0.0.23
0.0.13

Package Sidebar

Install

npm i webfont-loader

Weekly Downloads

78

Version

1.1.0

License

MIT

Last publish

Collaborators

  • cymen