Created
February 27, 2012 20:49
-
-
Save ardell/1926928 to your computer and use it in GitHub Desktop.
Font Profiler
This file contains 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
// Do this to find out the font style usage on a given page | |
var styles = { 300: { 'normal': 0, 'italic': 0}, 400: { 'normal': 0, 'italic': 0}, 500: { 'normal': 0, 'italic': 0}, 700: { 'normal': 0, 'italic': 0} }; | |
jQuery('body *').each(function(i, e) { var $e = jQuery(e); var weight = $e.css('font-weight'); if (weight == 'normal') weight = 400; if (weight == 'bold') weight = 700; var style = $e.css('font-style'); styles[weight][style] += 1; }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment