JSFiddle - React, Tailwind, and code Playground

by netme

HTML

<script src="http://www.lalit.org/wordpress/wp-content/uploads/2008/05/fontdetect.js?ver=0.3"></script>
<div class="abc">
    <div class="abcd">
        <div id="abcde">Abcde</div>
    </div>
</div>

CSS

body  { font-family: arial; }
#abcde  { font-family: dsasdasdagsdahsdga,tahoma; }

JavaScript

$(function() {
    var detectFont = function(fonts) {
        var detective = new Detector(), i;
        for (i = 0; i < fonts.length; ++i) {
           if (detective.detect(fonts[i]) !== true) {
               continue
           }
           return fonts[i];
        }    
    }
    var fonts = $('#abcde').css('font-family');
    fonts = fonts.split(',');
    console.log(detectFont(fonts));
});