available-fonts

1.0.0 • Public • Published

MIT License CircleCI

Available Fonts

Getting available fonts on browser without flash
see Demo Page

This methods based on http://www.lalit.org/lab/javascript-css-font-detect/

Usage

simple

var testFonts = ['font family...'];
var availableFontsList = availableFonts(testFonts);

if you use our test fonts list, try below code.

(function() {
  var xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function() {
    if (xhr.readyState === 4 && xhr.status === 200) {
      var testFonts = JSON.parse(xhr.responseText).testfonts;
      var availableFontsList = availableFonts(testFonts);
      document.body.appendChild(document.createTextNode(availableFontsList.join(', ')));
    }
  };
  xhr.open('GET', 'testfonts.json');
  xhr.send();
}())

Feature Works

  • Optimize test fonts list for Browser Fingerprinting

License

This project is licensed under the MIT License - see the LICENSE file for details

Package Sidebar

Install

npm i available-fonts

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • orleika