Skip to content

Instantly share code, notes, and snippets.

@gabriel
Created July 1, 2009 08:56
Show Gist options
  • Save gabriel/138690 to your computer and use it in GitHub Desktop.
Save gabriel/138690 to your computer and use it in GitHub Desktop.
<!-- element for SWF to load into -->
<div id="font-detect-swf"></div>
<script src="javascripts/jquery-1.2.6.pack.js"></script>
<script src="javascripts/swfobject.js"></script>
<script src="javascripts/font-detect.js"></script>
<script>
$(document).ready(function() {
var fontDetect = new FontDetect("font-detect-swf", "flash/FontList.swf", function(fd) {
var fonts = fd.fonts();
// Do something with fonts, which look like: [ { fontName:'Arial', fontStyle:'regular' fontType:'device' }, .... ]
// for(var i = 0; i < fonts.length; i++) {
// var name = fonts[i].fontName;
// }
};
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment