0.0.14 • Published 9 years ago

teespring-webfont-loader v0.0.14

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

webfont-loader

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() {
    // ...
  }
);