Squish the font bitmaps

This commit is contained in:
Joshua Bell 2013-08-18 15:30:55 -07:00
parent 7c8cdfe460
commit 0a509a7360
5 changed files with 844 additions and 844 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
font.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -1,13 +1,15 @@
function pos(code, sw) {
var x = Math.floor(code / 16);
var y = code % 16;
x = -( sw > 40 ? 1 : 2 )* (3 + 13 * x);
y = -2 * (4 + 13 * y);
var sx = ( sw > 40 ? 1 : 2 );
var sy = 2;
x = -sx * (7 * x);
y = -sy * (8 * y);
return String(x) + 'px ' + String(y) + 'px';
}
function gen(cc, sc, sw, styles) {
console.log('.'+sw+'col'+styles+' .jsb-chr'+cc+' { background-position: '+ pos(sc,sw)+' }');
console.log('.jsb-'+sw+'col'+styles+' .jsb-chr'+cc+' { background-position: '+ pos(sc,sw)+' }');
}
var sw, i;
@ -23,16 +25,16 @@ for( sw = 40; sw <= 80; sw += 40) {
// 0x60-0x7F = FLASH !"#$…<=>?
for (i = 0x00; i < 0x20; i++) { gen(i+0x40, i+0x40, sw, ''); }
for (i = 0x00; i < 0x20; i++) { gen(i+0x40, i+0xC0, sw, '.flash'); }
for (i = 0x00; i < 0x20; i++) { gen(i+0x40, i+0xC0, sw, '.jsb-flash'); }
for (i = 0x00; i < 0x20; i++) { gen(i+0x60, i+0x20, sw, ''); }
for (i = 0x00; i < 0x20; i++) { gen(i+0x60, i+0xA0, sw, '.flash'); }
for (i = 0x00; i < 0x20; i++) { gen(i+0x60, i+0xA0, sw, '.jsb-flash'); }
// 80-column firmware active
// 0x40-0x5F = MOUSETEXT
// 0x60-0x7F = INVERSE `abc…{|}~
for (i = 0x00; i < 0x20; i++) { gen(i+0x40, i+0x80, sw, '.active'); }
for (i = 0x00; i < 0x20; i++) { gen(i+0x60, i+0xE0, sw, '.active'); }
for (i = 0x00; i < 0x20; i++) { gen(i+0x40, i+0x80, sw, '.jsb-active'); }
for (i = 0x00; i < 0x20; i++) { gen(i+0x60, i+0xE0, sw, '.jsb-active'); }
// 0x80-0x9F = NORMAL @ABC…XYZ[\]^_
// 0xA0-0xBF = NORMAL !"#$…<=>?