1 // ////////////////////////////////////////////////////////////////////////// //
2 public __gshared
ubyte[256*8] vlFont6
= [
2311 // bits 4..7: lshift
2312 public __gshared
ubyte[256] vlFontPropWidth
;
2314 shared static this () {
2316 foreach (immutable cnum
; 0..256) {
2317 import core
.bitop
: bsf, bsr;
2319 (cnum
>= 32 && cnum
<= 127) ||
2320 (cnum
>= 143 && cnum
<= 144) ||
2321 (cnum
>= 166 && cnum
<= 167) ||
2322 (cnum
>= 192 && cnum
<= 255);
2326 foreach (immutable dy
; 0..8) {
2327 immutable b
= vlFont6
[cnum
*8+dy
];
2329 immutable mn
= 7-bsr(b
);
2330 if (mn
< shift
) shift
= mn
;
2335 foreach (immutable dy
; 0..8) {
2336 immutable b
= (vlFont6
[cnum
*8+dy
]<<shift
);
2337 immutable cwdt
= (b ?
8-bsf(b
) : 0);
2338 if (cwdt
> wdt
) wdt
= cast(ubyte)cwdt
;
2341 case 0: wdt
= 8; break; // 8px space
2342 case 32: wdt
= 5; break; // 5px space
2343 case 17: .. case 27: wdt
= 8; break; // single frames
2344 case 48: .. case 57: wdt
= 5; break; // digits are monospaced
2345 case 127: .. case 142: wdt
= 8; break; // filled frames
2346 case 145: .. case 151: wdt
= 8; break; // filled frames
2347 case 155: .. case 159: wdt
= 8; break; // filled frames
2350 res
[cnum
] = (wdt
&0x0f)|
((shift
<<4)&0xf0);
2352 vlFontPropWidth
[] = res
[];