mirror of
https://github.com/inexorabletash/jsbasic.git
synced 2024-12-14 02:30:10 +00:00
Squish the font bitmaps
This commit is contained in:
parent
7c8cdfe460
commit
0a509a7360
1672
display.css
1672
display.css
File diff suppressed because it is too large
Load Diff
BIN
font-40col.png
BIN
font-40col.png
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 2.4 KiB |
BIN
font-80col.png
BIN
font-80col.png
Binary file not shown.
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.1 KiB |
BIN
font.png
BIN
font.png
Binary file not shown.
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.6 KiB |
@ -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 !"#$…<=>?
|
||||
|
Loading…
Reference in New Issue
Block a user