This API checks for the existence of a specified font.
JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Latest commit ab265b9 Nov 18, 2017
Permalink
Failed to load latest commit information.
test Add parameter to specify DOM to be tested in Feb 10, 2015
LICENSE Initial commit Jan 27, 2015
README.md Update README.md Nov 17, 2017
jfont-checker.js Slight modification Feb 22, 2016

README.md

jFont Checker

This simple tool checks for the existence of a specified font. It ultilizes the font fallback mechanism in CSS for font checking.

Usage

Simply call checkfont, and it will return the font status in boolean:

var isTimesExist = checkfont("Times"),           //true (if exists)
    someWeirdFont = checkfont("CookieMonster");  //false

For whatever reason you need to test on a different DOM, another window for example (limited by SOP), you can pass that in too.

var win = window.open("/another_page");
checkfont("Century Gothic", win.document);