1.0.0 • Published 8 years ago

available-fonts v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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