Created
October 30, 2013 10:01
-
-
Save lebbe/7229985 to your computer and use it in GitHub Desktop.
I was looking for a font on android supporting the ⌫ character. Did not find any. You can turn this code into a "font with ⌫"-detector, by measuring the width of the span ⌫ is inside.
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
$(function() { | |
var fonts = ["cursive", "monospace", "serif", "sans-serif", "fantasy", "default", "Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT Bold", "Arial Unicode", "Bookman Old Style", "Bradley Hand ITC", "Century", "Century Gothic", "Comic Sans MS", "Courier", "Courier New", "Droid Sans", "Droid Serif", "Droid Sans Mono", "Georgia", "Gentium", "Impact", "King", "Lucida Console", "Lalit", "Modena", "Monotype Corsiva", "Papyrus", "Tahoma", "TeX", "Times", "Times New Roman", "Trebuchet MS", "Verdana", "Verona"]; | |
var $testField = $('<span>⌫</span>'); | |
for(var i = 0; i < fonts.length; i++) { | |
$clone = $testField.clone(); | |
$clone.css({ | |
'font-family': fonts[i] | |
}); | |
$('body').append($clone); | |
$('body').append('<span style="font-family: ' + fonts[i] +'">' + fonts[i] + ": " + $clone.width() + '</span>'); | |
$('body').append('<br>'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment