Ein wenig Wingdings
by juErik
HTML
<a href="http://localhost/eclipse/_system/wingding.ttf"></a>
<h2>Ein wenig Wingdings</h2>
<table border="0" id="out" cellpadding="6">
</table>
CSS
@font-face { font-family: 'Wingdings';
src: url('http://localhost/eclipse/_system/wingding.ttf') format('truetype'); }
.wdg{
font-family: 'Wingdings' !important;
font-size: 150%;
}
td{
width: 100px;
text-align: center;
}
JavaScript
$(function() {
// ============================================================================================
// gibt JS die PHP Function chr()
// welche Zeichen ausgibt anhand der ASCII-Nr. des Zeichen
function chr(codePt) {
// discuss at: http://phpjs.org/functions/chr/
// original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// improved by: Brett Zamir (http://brett-zamir.me)
// example 1: chr(75) === 'K';
// example 1: chr(65536) === '\uD800\uDC00';
// returns 1: true
// returns 1: true
if (codePt > 0xFFFF) { // Create a four-byte string (length 2) since this code point is high
// enough for the UTF-16 encoding (JavaScript internal use), to
// require representation with two surrogates (reserved non-characters
// used for building other characters; the first is "high" and the next "low")
codePt -= 0x10000;
return String.fromCharCode(0xD800 + (codePt >> 10), 0xDC00 + (codePt & 0x3FF));
}
return String.fromCharCode(codePt);
} // =========================================================================================
//$('.wdg').text( chr('232') );
for (i=1; i<=95; i++){
a = i + 32;
b = i + 160;
aa = chr(a);
bb = chr(b);
//c = i + 100;
text = '<tr><td>'+a+'</td><td>'+aa+'</td><td class="wdg">'+aa+'</td> <td> | </td> <td>'+
b+'</td><td>'+bb+'</td><td class="wdg">'+bb+'</td> </tr>';
$('#out').append( text );
}
});