fontformat

1.0.3 • Public • Published

Font Format Feature Detection

This library detects support for @font-face font formats without resorting to user agent sniffing. To do this efficiently, it makes the following assumptions:

  • All browsers support OpenType fonts (except IE6-8).
  • All browsers that support WOFF2 support WOFF.
  • All browsers that support WOFF support OpenType.

Usage

var fontformat = new FontFormat();

fontformat.detect().then(function (formats) {
  // formats = ['opentype', 'woff', 'woff2']
});

License

FontFormat is licensed under the BSD License. Copyright 2015 Bram Stein. All rights reserved.

Readme

Keywords

none

Package Sidebar

Install

npm i fontformat

Weekly Downloads

1

Version

1.0.3

License

BSD

Last publish

Collaborators

  • bramstein