Skip to content

Instantly share code, notes, and snippets.

@adamhut
Forked from JacobBennett/fonts.js
Created August 8, 2019 17:17
Show Gist options
  • Save adamhut/790aa09886944e3b88717602892fec38 to your computer and use it in GitHub Desktop.
Save adamhut/790aa09886944e3b88717602892fec38 to your computer and use it in GitHub Desktop.
List all font styles being used on the page
var ret={};
$('*').each(function () {
var str = $(this).css('font-family');
str = str + ':' + $(this).css('font-weight');
str = str + ':' + $(this).css('font-style');
if (ret[str] ) {
ret[str] = ret[str] + 1;
} else {
ret[str] = 1;
}
});
console.log(ret);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment