This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extract_characters_by_font(font_name) { | |
var allElems = document.querySelectorAll('*'); | |
var characters = Array.prototype | |
.filter.call(allElems, function (elem) { | |
var fonts = getComputedStyle(elem)['font-family'].split(',').map(function(font){ | |
return font.trim().replace(/'/g,''); | |
}); | |
return fonts.indexOf(font_name) > -1; | |
}) | |
.map(function (elem) { |
NewerOlder