1 /* Invisible Vector Library
2 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
3 * Understanding is not required. Only obedience.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3 of the License ONLY.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 module iv
.vl2
.font6
/*is aliced*/;
21 // ////////////////////////////////////////////////////////////////////////// //
22 public immutable ubyte[$] vlFont6
= [
2331 // bits 4..7: lshift
2332 public immutable ubyte[256] vlFontPropWidth
= () {
2334 foreach (immutable cnum
; 0..256) {
2335 import core
.bitop
: bsf, bsr;
2337 (cnum
>= 32 && cnum
<= 127) ||
2338 (cnum
>= 143 && cnum
<= 144) ||
2339 (cnum
>= 166 && cnum
<= 167) ||
2340 (cnum
>= 192 && cnum
<= 255);
2344 foreach (immutable dy
; 0..8) {
2345 immutable b
= vlFont6
[cnum
*8+dy
];
2347 immutable mn
= 7-bsr(b
);
2348 if (mn
< shift
) shift
= mn
;
2353 foreach (immutable dy
; 0..8) {
2354 immutable b
= (vlFont6
[cnum
*8+dy
]<<shift
);
2355 immutable cwdt
= (b ?
8-bsf(b
) : 0);
2356 if (cwdt
> wdt
) wdt
= cast(ubyte)cwdt
;
2359 case 0: wdt
= 8; break; // 8px space
2360 case 32: wdt
= 5; break; // 5px space
2361 case 17: .. case 27: wdt
= 8; break; // single frames
2362 case 48: .. case 57: wdt
= 5; break; // digits are monospaced
2363 case 127: .. case 142: wdt
= 8; break; // filled frames
2364 case 145: .. case 151: wdt
= 8; break; // filled frames
2365 case 155: .. case 159: wdt
= 8; break; // filled frames
2368 res
[cnum
] = (wdt
&0x0f)|
((shift
<<4)&0xf0);