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