@flourish/font-watcher

0.0.2 • Public • Published

Flourish font watcher

The function exported from this module will call window.template.update() (or another function) when any new fonts are loaded.

How to install

npm install -s @flourish/font-watcher

Then import it with:

import addFontWatcher from "@flourish/font-watcher";

Usage

If no callback is specified, then addFontWatcher will call window.template.update() whenever it detects that a new font has been loaded:

addFontWatcher();

If you supply a callback, then it will be called with a FontFaceSetLoadEvent object as the parameter. For example, you can do:

addFontWatcher(function () {
    console.log("Fonts have loaded");
});

Readme

Keywords

none

Package Sidebar

Install

npm i @flourish/font-watcher

Weekly Downloads

120

Version

0.0.2

License

UNLICENSED

Unpacked Size

3.84 kB

Total Files

7

Last publish

Collaborators

  • jontyt
  • rushlet
  • winna_canva
  • bruno-riddy
  • libruca
  • jwitcombe
  • katietannercanva
  • b3n-canva
  • caletilford
  • florin.oprina
  • robinhouston
  • duncanclark
  • daanlouter
  • hughsk
  • mark-kiln
  • animateddata
  • larsvers
  • luptilu
  • bobbysebolao
  • hrobertson
  • oampo