Last active
December 8, 2015 11:22
-
-
Save mcalthrop/62dd6dc395bf2864f6af to your computer and use it in GitHub Desktop.
Font-awesome icons as characters
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
<html> | |
<head> | |
<title>Font-awesome icons as characters</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> | |
<style> | |
* { | |
font-family: Helvetica, Arial, sans-serif; | |
} | |
.fa-char { | |
font-family: FontAwesome; | |
font-size: 24px; | |
} | |
td { | |
min-width: 100px; | |
text-align: center; | |
} | |
</style> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js"></script> | |
</head> | |
<body> | |
<p><a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">Font-awesome icons</a></p> | |
<table> | |
<thead> | |
<tr> | |
<th>Dec</th> | |
<th>Hex</th> | |
<th>Entity</th> | |
<th>Icon</th> | |
</tr> | |
</thead> | |
<tbody> | |
<script> | |
var numbers = _.range(0, 670); | |
_.each(numbers, function (number) { | |
// example:  | |
var hexNumberString = this.padLeft(number.toString(16), 3, '0'); | |
document.writeln('<tr><td>' + number + '</td><td>' + hexNumberString + '</td><td>&#xf' + hexNumberString + ';</td><td class="fa-char">' + hexNumberString + ';</td></tr>'); | |
}, _); | |
</script> | |
</tbody> | |
</table> | |
<p> | |
<span class="fa-char"></span> | |
<span class="fa-char"></span> | |
<span class="fa-char"></span> | |
</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment