Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

js-css-font-detect

oculus4220Apache-2.00.4.0

Font Detect - Based on Lalit Patel's 2012 code

font-detect, fonts, clientjs

readme

Font Detect

Based on js-css-font-detect by Lalit Patel.

npm version

About

0.3.0 is the original code from 2012. If you want the original, npm install js-css-font-detect@0.3.0.

0.4.0 is a minor performance optimization (up to ~10%) with the same browser support as the original.

Usage


var d = new Detector();
d.detect('font name');

TODO

  • Provide minified version.
  • Significantly speed detection for arrays to improve libraries like ClientJS.

changelog

CHANGELOG

JavaScript code to detect available availability of a particular font in a browser using JavaScript and CSS.

0.4.0 - 2019-08-13

  • Minor optimization reduces run time by ~10%.
  • Add version to the instance for convenient reference.
  • Add README.md.

0.3.0 - 2019-08-11

  • Created & published npm package.

0.3 - 2012-03-24

  • Replaced sans with serif in the list of baseFonts

0.2 - 2012-03-04

  • Comparing font against all the 3 generic font families ie, 'monospace', 'sans-serif' and 'sans'. If it doesn't match all 3 then that font is 100% not available in the system

0.15 - 2009-09-21

Changed comparision font to default from sans-default-default, as in FF3.0 font of child element didn't fallback to parent element if the font is missing.