cosmetix
[mmd.git] / x11gfx.d
blob388c9b29f44763f5558f115e239eee3ffe6f6967
1 /* coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
2 * Understanding is not required. Only obedience.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
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 x11gfx;
19 import arsd.simpledisplay;
20 //import arsd.color;
23 // ////////////////////////////////////////////////////////////////////////// //
24 // 0:b; 1:g; 2:r; 3: nothing
25 __gshared int vbufW = 256, vbufH = 192;
26 __gshared uint[] vbuf;
27 __gshared bool blit2x = true;
28 enum BlitType { Normal, BlackWhite, Green }
29 __gshared int blitType = BlitType.Normal;
30 __gshared Image vbimg;
31 __gshared SimpleWindow vbwin;
34 // ////////////////////////////////////////////////////////////////////////// //
35 void x11gfxDeinit () {
36 flushGui();
37 if (vbimg !is null) delete vbimg;
38 if (vbwin !is null) { if (!vbwin.closed) vbwin.close(); delete vbwin; }
39 if (vbuf !is null) delete vbuf;
40 vbimg = null;
41 vbwin = null;
42 vbuf = null;
43 flushGui();
47 SimpleWindow x11gfxInit (string title) {
48 if (vbufW < 1 || vbufH < 1 || vbufW > 4096 || vbufH > 4096) assert(0, "invalid dimensions");
49 initVBuf();
50 vbwin = new SimpleWindow(vbufW*(blit2x ? 2 : 1), vbufH*(blit2x ? 2 : 1), title, OpenGlOptions.no, Resizablity.fixedSize);
51 vbimg = new Image(vbufW*(blit2x ? 2 : 1), vbufH*(blit2x ? 2 : 1));
52 return vbwin;
56 void x11gfxBlit () {
57 if (vbwin is null || vbwin.closed) return;
58 auto painter = vbwin.draw();
59 painter.drawImage(Point(0, 0), vbimg);
63 // ////////////////////////////////////////////////////////////////////////// //
64 final class X11Image {
65 int width, height;
66 VColor[] data;
68 this (int w, int h) {
69 assert(w > 0 && w <= 4096);
70 assert(h > 0 && h <= 4096);
71 width = w;
72 height = h;
73 data.length = w*h;
74 data[] = Transparent;
77 VColor getPixel (int x, int y) const {
78 return (x >= 0 && y >= 0 && x < width && y < height ? data[y*width+x] : Transparent);
81 void setPixel (int x, int y, VColor c) {
82 if (x >= 0 && y >= 0 && x < width && y < height) data[y*width+x] = c;
85 void blitFast (int x, int y) const {
86 if (width < 1 || height < 1) return;
87 if (x <= -width || y <= -height) return;
88 if (x >= vbufW || y >= vbufH) return;
89 auto src = cast(const(VColor)*)data.ptr;
90 if (x >= 0 && y >= 0 && x+width < vbufW && y+height < vbufH) {
91 auto d = cast(uint*)vbuf.ptr;
92 d += vbufW*y+x;
93 foreach (int dy; 0..height) {
94 d[0..width] = src[0..width];
95 src += width;
96 d += vbufW;
98 } else {
99 foreach (int dy; 0..height) {
100 foreach (int dx; 0..width) {
101 .setPixel(x+dx, y+dy, *src++);
107 void blit (int x, int y) const {
108 if (width < 1 || height < 1) return;
109 if (x <= -width || y <= -height) return;
110 if (x >= vbufW || y >= vbufH) return;
111 auto src = cast(const(VColor)*)data.ptr;
112 foreach (int dy; 0..height) {
113 foreach (int dx; 0..width) {
114 putPixel(x+dx, y+dy, *src++);
121 private void initVBuf () {
122 vbuf.length = vbufW*vbufH;
123 vbuf[] = 0;
127 private {
128 void blit2xImpl(string op, bool scanlines=true) (Image img) {
129 static if (UsingSimpledisplayX11) {
130 auto s = cast(const(ubyte)*)vbuf.ptr;
131 immutable iw = img.width;
132 auto dd = cast(uint*)img.getDataPointer;
133 foreach (immutable int dy; 0..vbufH) {
134 if (dy*2+1 >= img.height) return;
135 auto d = dd+iw*(dy*2);
136 foreach (immutable int dx; 0..vbufW) {
137 if (dx+1 < iw) {
138 static if (op.length) mixin(op);
139 static if (scanlines) {
140 immutable uint c1 = ((((c0&0x00ff00ff)*6)>>3)&0x00ff00ff)|(((c0&0x0000ff00)*6)>>3)&0x0000ff00;
141 } else {
142 alias c1 = c0;
144 d[0] = d[1] = c0;
145 d[iw+0] = d[iw+1] = c1;
146 d += 2;
147 s += 4;
151 } else {
152 // this sux
153 immutable bpp = img.bytesPerPixel();
154 immutable rofs = img.redByteOffset;
155 immutable gofs = img.greenByteOffset;
156 immutable bofs = img.blueByteOffset;
157 immutable nlo = img.adjustmentForNextLine;
158 auto s = cast(const(ubyte)*)vbuf.ptr;
159 immutable iw = img.width;
160 auto dd = cast(ubyte*)img.getDataPointer;
161 foreach (immutable int dy; 0..vbufH) {
162 if (dy*2+1 >= img.height) return;
163 auto d = dd+img.offsetForPixel(0, dy*2);
164 foreach (immutable int dx; 0..vbufW) {
165 if (dx+1 < iw) {
166 static if (op.length) mixin(op);
167 static if (scanlines) {
168 immutable uint c1 = ((((c0&0x00ff00ff)*6)>>3)&0x00ff00ff)|(((c0&0x0000ff00)*6)>>3)&0x0000ff00;
169 } else {
170 alias c1 = c0;
172 d[bofs] = d[bofs+bpp] = c0&0xff;
173 d[gofs] = d[gofs+bpp] = (c0>>8)&0xff;
174 d[rofs] = d[rofs+bpp] = (c0>>16)&0xff;
175 d[bofs+nlo] = d[bofs+nlo+bpp] = c0&0xff;
176 d[gofs+nlo] = d[gofs+nlo+bpp] = (c0>>8)&0xff;
177 d[rofs+nlo] = d[rofs+nlo+bpp] = (c0>>16)&0xff;
178 d += bpp*2;
179 s += 4;
186 alias blit2xTV = blit2xImpl!"immutable uint c0 = (cast(immutable(uint)*)s)[0];";
187 alias blit2xTVBW = blit2xImpl!"immutable ubyte i = cast(ubyte)((s[0]*28+s[1]*151+s[2]*77)/256); immutable uint c0 = (i<<16)|(i<<8)|i;";
188 alias blit2xTVGreen = blit2xImpl!"immutable ubyte i = cast(ubyte)((s[0]*28+s[1]*151+s[2]*77)/256); immutable uint c0 = i<<8;";
192 void realizeVBuf (/*Image img*/) {
193 if (vbimg is null) return;
194 Image img = vbimg;
196 auto sp = vbuf.ptr;
197 auto dp = cast(uint*)img.getDataPointer;
198 import core.stdc.string : memcpy;
199 memcpy(dp, sp, vbufW*vbufH*4);
201 if (blit2x) {
202 if (img.width < vbufW*2 || img.height < vbufH*2) return;
203 switch (blitType) {
204 case BlitType.BlackWhite: blit2xTVBW(img); break;
205 case BlitType.Green: blit2xTVGreen(img); break;
206 default: blit2xTV(img); break;
208 } else {
209 if (img.width < vbufW || img.height < vbufH) return;
210 static if (UsingSimpledisplayX11) {
211 auto dp = cast(uint*)img.getDataPointer;
212 dp[0..vbufW*vbufH] = vbuf.ptr[0..vbufW*vbufH];
213 } else {
214 // this sux
215 auto sp = cast(ubyte*)vbuf.ptr;
216 auto dp = cast(ubyte*)img.getDataPointer;
217 immutable bpp = img.bytesPerPixel();
218 immutable rofs = img.redByteOffset;
219 immutable gofs = img.greenByteOffset;
220 immutable bofs = img.blueByteOffset;
221 foreach (immutable y; 0..vbufH) {
222 auto d = dp+img.offsetForTopLeftPixel;
223 foreach (immutable x; 0..vbufW) {
224 d[bofs] = *sp++;
225 d[gofs] = *sp++;
226 d[rofs] = *sp++;
227 ++sp;
228 d += bpp;
236 // ////////////////////////////////////////////////////////////////////////// //
237 ubyte clampToByte(T) (T n) @safe pure nothrow @nogc
238 if (__traits(isIntegral, T) && (T.sizeof == 2 || T.sizeof == 4))
240 static if (__VERSION__ > 2067) pragma(inline, true);
241 n &= -cast(int)(n >= 0);
242 return cast(ubyte)(n|((255-cast(int)n)>>31));
245 ubyte clampToByte(T) (T n) @safe pure nothrow @nogc
246 if (__traits(isIntegral, T) && T.sizeof == 1)
248 static if (__VERSION__ > 2067) pragma(inline, true);
249 return cast(ubyte)n;
253 // ////////////////////////////////////////////////////////////////////////// //
254 alias VColor = uint;
256 /// vlRGBA struct to ease color components extraction/replacing
257 align(1) struct vlRGBA {
258 align(1):
259 ubyte b, g, r, a;
261 static assert(vlRGBA.sizeof == VColor.sizeof);
264 enum : VColor {
265 vlAMask = 0xff000000u,
266 vlRMask = 0x00ff0000u,
267 vlGMask = 0x0000ff00u,
268 vlBMask = 0x000000ffu
271 enum : VColor {
272 vlAShift = 24,
273 vlRShift = 16,
274 vlGShift = 8,
275 vlBShift = 0
279 enum VColor Transparent = vlAMask; /// completely transparent pixel color
282 bool isTransparent(T : VColor) (T col) @safe pure nothrow @nogc {
283 static if (__VERSION__ > 2067) pragma(inline, true);
284 return ((col&vlAMask) == vlAMask);
287 bool isOpaque(T : VColor) (T col) @safe pure nothrow @nogc {
288 static if (__VERSION__ > 2067) pragma(inline, true);
289 return ((col&vlAMask) == 0);
292 // a=0: opaque
293 VColor rgbcol(TR, TG, TB, TA=ubyte) (TR r, TG g, TB b, TA a=0) @safe pure nothrow @nogc
294 if (__traits(isIntegral, TR) && __traits(isIntegral, TG) && __traits(isIntegral, TB) && __traits(isIntegral, TA)) {
295 static if (__VERSION__ > 2067) pragma(inline, true);
296 return
297 (clampToByte(a)<<vlAShift)|
298 (clampToByte(r)<<vlRShift)|
299 (clampToByte(g)<<vlGShift)|
300 (clampToByte(b)<<vlBShift);
303 alias rgbacol = rgbcol;
306 // generate some templates
307 private enum genRGBGetSet(string cname) =
308 "ubyte rgb"~cname~"() (VColor clr) @safe pure nothrow @nogc {\n"~
309 " static if (__VERSION__ > 2067) pragma(inline, true);\n"~
310 " return ((clr>>vl"~cname[0]~"Shift)&0xff);\n"~
311 "}\n"~
312 "VColor rgbSet"~cname~"(T) (VColor clr, T v) @safe pure nothrow @nogc if (__traits(isIntegral, T)) {\n"~
313 " static if (__VERSION__ > 2067) pragma(inline, true);\n"~
314 " return (clr&~vl"~cname[0]~"Mask)|(clampToByte(v)<<vl"~cname[0]~"Shift);\n"~
315 "}\n";
317 mixin(genRGBGetSet!"Alpha");
318 mixin(genRGBGetSet!"Red");
319 mixin(genRGBGetSet!"Green");
320 mixin(genRGBGetSet!"Blue");
323 void putPixel(TX, TY) (TX x, TY y, VColor col) @trusted
324 if (__traits(isIntegral, TX) && __traits(isIntegral, TY))
326 static if (__VERSION__ > 2067) pragma(inline, true);
327 immutable long xx = cast(long)x;
328 immutable long yy = cast(long)y;
329 if ((col&vlAMask) != vlAMask && xx >= 0 && yy >= 0 && xx < vbufW && yy < vbufH) {
330 uint* da = vbuf.ptr+yy*vbufW+xx;
331 if (col&vlAMask) {
332 immutable uint a = 256-(col>>24); // to not loose bits
333 immutable uint dc = (*da)&0xffffff;
334 immutable uint srb = (col&0xff00ff);
335 immutable uint sg = (col&0x00ff00);
336 immutable uint drb = (dc&0xff00ff);
337 immutable uint dg = (dc&0x00ff00);
338 immutable uint orb = (drb+(((srb-drb)*a+0x800080)>>8))&0xff00ff;
339 immutable uint og = (dg+(((sg-dg)*a+0x008000)>>8))&0x00ff00;
340 *da = orb|og;
341 } else {
342 *da = col;
347 void setPixel(TX, TY) (TX x, TY y, VColor col) @trusted
348 if (__traits(isIntegral, TX) && __traits(isIntegral, TY))
350 static if (__VERSION__ > 2067) pragma(inline, true);
351 immutable long xx = cast(long)x;
352 immutable long yy = cast(long)y;
353 if (xx >= 0 && yy >= 0 && xx < vbufW && yy < vbufH) {
354 uint* da = vbuf.ptr+yy*vbufW+xx;
355 *da = col;
360 void drawLine(bool lastPoint=true) (int x0, int y0, int x1, int y1, immutable VColor col) {
361 enum swap(string a, string b) = "{int tmp_="~a~";"~a~"="~b~";"~b~"=tmp_;}";
363 if ((col&vlAMask) == vlAMask) return;
365 if (x0 == x1 && y0 == y1) {
366 static if (lastPoint) putPixel(x0, y0, col);
367 return;
370 // clip rectange
371 int wx0 = 0, wy0 = 0, wx1 = vbufW-1, wy1 = vbufH-1;
372 // other vars
373 int stx, sty; // "steps" for x and y axes
374 int dsx, dsy; // "lengthes" for x and y axes
375 int dx2, dy2; // "double lengthes" for x and y axes
376 int xd, yd; // current coord
377 int e; // "error" (as in bresenham algo)
378 int rem;
379 int term;
380 int *d0, d1;
381 // horizontal setup
382 if (x0 < x1) {
383 // from left to right
384 if (x0 > wx1 || x1 < wx0) return; // out of screen
385 stx = 1; // going right
386 } else {
387 // from right to left
388 if (x1 > wx1 || x0 < wx0) return; // out of screen
389 stx = -1; // going left
390 x0 = -x0;
391 x1 = -x1;
392 wx0 = -wx0;
393 wx1 = -wx1;
394 mixin(swap!("wx0", "wx1"));
396 // vertical setup
397 if (y0 < y1) {
398 // from top to bottom
399 if (y0 > wy1 || y1 < wy0) return; // out of screen
400 sty = 1; // going down
401 } else {
402 // from bottom to top
403 if (y1 > wy1 || y0 < wy0) return; // out of screen
404 sty = -1; // going up
405 y0 = -y0;
406 y1 = -y1;
407 wy0 = -wy0;
408 wy1 = -wy1;
409 mixin(swap!("wy0", "wy1"));
411 dsx = x1-x0;
412 dsy = y1-y0;
413 if (dsx < dsy) {
414 d0 = &yd;
415 d1 = &xd;
416 mixin(swap!("x0", "y0"));
417 mixin(swap!("x1", "y1"));
418 mixin(swap!("dsx", "dsy"));
419 mixin(swap!("wx0", "wy0"));
420 mixin(swap!("wx1", "wy1"));
421 mixin(swap!("stx", "sty"));
422 } else {
423 d0 = &xd;
424 d1 = &yd;
426 dx2 = 2*dsx;
427 dy2 = 2*dsy;
428 xd = x0;
429 yd = y0;
430 e = 2*dsy-dsx;
431 term = x1;
432 bool xfixed = false;
433 if (y0 < wy0) {
434 // clip at top
435 int temp = dx2*(wy0-y0)-dsx;
436 xd += temp/dy2;
437 rem = temp%dy2;
438 if (xd > wx1) return; // x is moved out of clipping rect, nothing to do
439 if (xd+1 >= wx0) {
440 yd = wy0;
441 e -= rem+dsx;
442 if (rem > 0) { ++xd; e += dy2; }
443 xfixed = true;
446 if (!xfixed && x0 < wx0) {
447 // clip at left
448 int temp = dy2*(wx0-x0);
449 yd += temp/dx2;
450 rem = temp%dx2;
451 if (yd > wy1 || yd == wy1 && rem >= dsx) return;
452 xd = wx0;
453 e += rem;
454 if (rem >= dsx) { ++yd; e -= dx2; }
456 if (y1 > wy1) {
457 // clip at bottom
458 int temp = dx2*(wy1-y0)+dsx;
459 term = x0+temp/dy2;
460 rem = temp%dy2;
461 if (rem == 0) --term;
463 if (term > wx1) term = wx1; // clip at right
464 static if (lastPoint) {
465 // draw last point
466 ++term;
467 } else {
468 if (term == xd) return; // this is the only point, get out of here
470 if (sty == -1) yd = -yd;
471 if (stx == -1) { xd = -xd; term = -term; }
472 dx2 -= dy2;
473 // draw it; `putPixel()` can omit checks
474 while (xd != term) {
475 // inlined `putPixel(*d0, *d1, col)`
476 // this can be made even faster by precalculating `da` and making
477 // separate code branches for mixing and non-mixing drawing, but...
478 // ah, screw it!
479 uint* da = vbuf.ptr+(*d1)*vbufW+(*d0);
480 if (col&vlAMask) {
481 immutable uint a = 256-(col>>24); // to not loose bits
482 immutable uint dc = (*da)&0xffffff;
483 immutable uint srb = (col&0xff00ff);
484 immutable uint sg = (col&0x00ff00);
485 immutable uint drb = (dc&0xff00ff);
486 immutable uint dg = (dc&0x00ff00);
487 immutable uint orb = (drb+(((srb-drb)*a+0x800080)>>8))&0xff00ff;
488 immutable uint og = (dg+(((sg-dg)*a+0x008000)>>8))&0x00ff00;
489 *da = orb|og;
490 } else {
491 *da = col;
493 // done drawing, move coords
494 if (e >= 0) {
495 yd += sty;
496 e -= dx2;
497 } else {
498 e += dy2;
500 xd += stx;
505 // //////////////////////////////////////////////////////////////////////// //
507 * Draw character onto virtual screen in KOI8 encoding.
509 * Params:
510 * x = x coordinate
511 * y = y coordinate
512 * wdt = char width
513 * shift = shl count
514 * ch = character
515 * col = foreground color
516 * bkcol = background color
518 * Returns:
519 * nothing
521 void drawCharWdt (int x, int y, int wdt, int shift, char ch, VColor col, VColor bkcol=Transparent) @trusted {
522 size_t pos = ch*8;
523 if (wdt < 1 || shift >= 8) return;
524 if (col == Transparent && bkcol == Transparent) return;
525 if (wdt > 8) wdt = 8;
526 if (shift < 0) shift = 0;
527 foreach (immutable int dy; 0..8) {
528 ubyte b = cast(ubyte)(vlFont6[pos++]<<shift);
529 foreach (immutable int dx; 0..wdt) {
530 VColor c = (b&0x80 ? col : bkcol);
531 if (!isTransparent(c)) putPixel(x+dx, y+dy, c);
532 b = (b<<1)&0xff;
537 // outline types
538 enum : ubyte {
539 OutLeft = 0x01,
540 OutRight = 0x02,
541 OutUp = 0x04,
542 OutDown = 0x08,
543 OutLU = 0x10, // left-up
544 OutRU = 0x20, // right-up
545 OutLD = 0x40, // left-down
546 OutRD = 0x80, // right-down
547 OutAll = 0xff,
551 * Draw outlined character onto virtual screen in KOI8 encoding.
553 * Params:
554 * x = x coordinate
555 * y = y coordinate
556 * wdt = char width
557 * shift = shl count
558 * ch = character
559 * col = foreground color
560 * outcol = outline color
561 * ot = outline type, OutXXX, ored
563 * Returns:
564 * nothing
566 void drawCharWdtOut (int x, int y, int wdt, int shift, char ch, VColor col, VColor outcol=Transparent, ubyte ot=0) @trusted {
567 if (col == Transparent && outcol == Transparent) return;
568 if (ot == 0 || outcol == Transparent) {
569 // no outline? simple draw
570 drawCharWdt(x, y, wdt, shift, ch, col, Transparent);
571 return;
573 size_t pos = ch*8;
574 if (wdt < 1 || shift >= 8) return;
575 if (wdt > 8) wdt = 8;
576 if (shift < 0) shift = 0;
577 ubyte[8+2][8+2] bmp = 0; // char bitmap; 0: empty; 1: char; 2: outline
578 foreach (immutable dy; 1..9) {
579 ubyte b = cast(ubyte)(vlFont6[pos++]<<shift);
580 foreach (immutable dx; 1..wdt+1) {
581 if (b&0x80) {
582 // put pixel
583 bmp[dy][dx] = 1;
584 // put outlines
585 if ((ot&OutUp) && bmp[dy-1][dx] == 0) bmp[dy-1][dx] = 2;
586 if ((ot&OutDown) && bmp[dy+1][dx] == 0) bmp[dy+1][dx] = 2;
587 if ((ot&OutLeft) && bmp[dy][dx-1] == 0) bmp[dy][dx-1] = 2;
588 if ((ot&OutRight) && bmp[dy][dx+1] == 0) bmp[dy][dx+1] = 2;
589 if ((ot&OutLU) && bmp[dy-1][dx-1] == 0) bmp[dy-1][dx-1] = 2;
590 if ((ot&OutRU) && bmp[dy-1][dx+1] == 0) bmp[dy-1][dx+1] = 2;
591 if ((ot&OutLD) && bmp[dy+1][dx-1] == 0) bmp[dy+1][dx-1] = 2;
592 if ((ot&OutRD) && bmp[dy+1][dx+1] == 0) bmp[dy+1][dx+1] = 2;
594 b = (b<<1)&0xff;
597 // now draw it
598 --x;
599 --y;
600 foreach (immutable int dy; 0..10) {
601 foreach (immutable int dx; 0..10) {
602 if (auto t = bmp[dy][dx]) putPixel(x+dx, y+dy, (t == 1 ? col : outcol));
608 * Draw 6x8 character onto virtual screen in KOI8 encoding.
610 * Params:
611 * x = x coordinate
612 * y = y coordinate
613 * ch = character
614 * col = foreground color
615 * bkcol = background color
617 * Returns:
618 * nothing
620 void drawChar (int x, int y, char ch, VColor col, VColor bkcol=Transparent) @trusted {
621 drawCharWdt(x, y, 6, 0, ch, col, bkcol);
624 void drawCharOut (int x, int y, char ch, VColor col, VColor outcol=Transparent, ubyte ot=OutAll) @trusted {
625 drawCharWdtOut(x, y, 6, 0, ch, col, outcol, ot);
628 void drawStr (int x, int y, string str, VColor col, VColor bkcol=Transparent) @trusted {
629 foreach (immutable char ch; str) {
630 drawChar(x, y, ch, col, bkcol);
631 x += 6;
635 void drawStrOut (int x, int y, string str, VColor col, VColor outcol=Transparent, ubyte ot=OutAll) @trusted {
636 foreach (immutable char ch; str) {
637 drawCharOut(x, y, ch, col, outcol, ot);
638 x += 6;
642 static int charWidthProp (char ch) @trusted pure { return (vlFontPropWidth[ch]&0x0f); }
644 int strWidthProp (string str) @trusted pure {
645 int wdt = 0;
646 foreach (immutable char ch; str) wdt += (vlFontPropWidth[ch]&0x0f)+1;
647 if (wdt > 0) --wdt; // don't count last empty pixel
648 return wdt;
651 int drawCharProp (int x, int y, char ch, VColor col, VColor bkcol=Transparent) @trusted {
652 immutable int wdt = (vlFontPropWidth[ch]&0x0f);
653 drawCharWdt(x, y, wdt, vlFontPropWidth[ch]>>4, ch, col, bkcol);
654 return wdt;
657 int drawCharPropOut (int x, int y, char ch, VColor col, VColor outcol=Transparent, ubyte ot=OutAll) @trusted {
658 immutable int wdt = (vlFontPropWidth[ch]&0x0f);
659 drawCharWdtOut(x, y, wdt, vlFontPropWidth[ch]>>4, ch, col, outcol, ot);
660 return wdt;
663 int drawStrProp (int x, int y, string str, VColor col, VColor bkcol=Transparent) @trusted {
664 bool vline = false;
665 int sx = x;
666 foreach (immutable char ch; str) {
667 if (vline) {
668 if (!isTransparent(bkcol)) foreach (int dy; 0..8) putPixel(x, y+dy, bkcol);
669 ++x;
671 vline = true;
672 x += drawCharProp(x, y, ch, col, bkcol);
674 return x-sx;
677 int drawStrPropOut (int x, int y, string str, VColor col, VColor outcol=Transparent, ubyte ot=OutAll) @trusted {
678 int sx = x;
679 foreach (immutable char ch; str) {
680 x += drawCharPropOut(x, y, ch, col, outcol, ot)+1;
682 if (x > sx) --x; // don't count last empty pixel
683 return x-sx;
686 // ////////////////////////////////////////////////////////////////////////// //
687 void clear (VColor col) @trusted {
688 vbuf.ptr[0..vbufW*vbufH] = col;
692 // ////////////////////////////////////////////////////////////////////////// //
693 public immutable ubyte[256*8] vlFont6 = [
694 /* 0 */
695 0b_00000000,
696 0b_00000000,
697 0b_00000000,
698 0b_00000000,
699 0b_00000000,
700 0b_00000000,
701 0b_00000000,
702 0b_00000000,
703 /* 1 */
704 0b_00111100,
705 0b_01000010,
706 0b_10100101,
707 0b_10000001,
708 0b_10100101,
709 0b_10011001,
710 0b_01000010,
711 0b_00111100,
712 /* 2 */
713 0b_00111100,
714 0b_01111110,
715 0b_11011011,
716 0b_11111111,
717 0b_11111111,
718 0b_11011011,
719 0b_01100110,
720 0b_00111100,
721 /* 3 */
722 0b_01101100,
723 0b_11111110,
724 0b_11111110,
725 0b_11111110,
726 0b_01111100,
727 0b_00111000,
728 0b_00010000,
729 0b_00000000,
730 /* 4 */
731 0b_00010000,
732 0b_00111000,
733 0b_01111100,
734 0b_11111110,
735 0b_01111100,
736 0b_00111000,
737 0b_00010000,
738 0b_00000000,
739 /* 5 */
740 0b_00010000,
741 0b_00111000,
742 0b_01010100,
743 0b_11111110,
744 0b_01010100,
745 0b_00010000,
746 0b_00111000,
747 0b_00000000,
748 /* 6 */
749 0b_00010000,
750 0b_00111000,
751 0b_01111100,
752 0b_11111110,
753 0b_11111110,
754 0b_00010000,
755 0b_00111000,
756 0b_00000000,
757 /* 7 */
758 0b_00000000,
759 0b_00000000,
760 0b_00000000,
761 0b_00110000,
762 0b_00110000,
763 0b_00000000,
764 0b_00000000,
765 0b_00000000,
766 /* 8 */
767 0b_11111111,
768 0b_11111111,
769 0b_11111111,
770 0b_11100111,
771 0b_11100111,
772 0b_11111111,
773 0b_11111111,
774 0b_11111111,
775 /* 9 */
776 0b_00111000,
777 0b_01000100,
778 0b_10000010,
779 0b_10000010,
780 0b_10000010,
781 0b_01000100,
782 0b_00111000,
783 0b_00000000,
784 /* 10 */
785 0b_11000111,
786 0b_10111011,
787 0b_01111101,
788 0b_01111101,
789 0b_01111101,
790 0b_10111011,
791 0b_11000111,
792 0b_11111111,
793 /* 11 */
794 0b_00001111,
795 0b_00000011,
796 0b_00000101,
797 0b_01111001,
798 0b_10001000,
799 0b_10001000,
800 0b_10001000,
801 0b_01110000,
802 /* 12 */
803 0b_00111000,
804 0b_01000100,
805 0b_01000100,
806 0b_01000100,
807 0b_00111000,
808 0b_00010000,
809 0b_01111100,
810 0b_00010000,
811 /* 13 */
812 0b_00110000,
813 0b_00101000,
814 0b_00100100,
815 0b_00100100,
816 0b_00101000,
817 0b_00100000,
818 0b_11100000,
819 0b_11000000,
820 /* 14 */
821 0b_00111100,
822 0b_00100100,
823 0b_00111100,
824 0b_00100100,
825 0b_00100100,
826 0b_11100100,
827 0b_11011100,
828 0b_00011000,
829 /* 15 */
830 0b_00010000,
831 0b_01010100,
832 0b_00111000,
833 0b_11101110,
834 0b_00111000,
835 0b_01010100,
836 0b_00010000,
837 0b_00000000,
838 /* 16 */
839 0b_00010000,
840 0b_00010000,
841 0b_00010000,
842 0b_01111100,
843 0b_00010000,
844 0b_00010000,
845 0b_00010000,
846 0b_00010000,
847 /* 17 */
848 0b_00010000,
849 0b_00010000,
850 0b_00010000,
851 0b_11111111,
852 0b_00000000,
853 0b_00000000,
854 0b_00000000,
855 0b_00000000,
856 /* 18 */
857 0b_00000000,
858 0b_00000000,
859 0b_00000000,
860 0b_11111111,
861 0b_00010000,
862 0b_00010000,
863 0b_00010000,
864 0b_00010000,
865 /* 19 */
866 0b_00010000,
867 0b_00010000,
868 0b_00010000,
869 0b_11110000,
870 0b_00010000,
871 0b_00010000,
872 0b_00010000,
873 0b_00010000,
874 /* 20 */
875 0b_00010000,
876 0b_00010000,
877 0b_00010000,
878 0b_00011111,
879 0b_00010000,
880 0b_00010000,
881 0b_00010000,
882 0b_00010000,
883 /* 21 */
884 0b_00010000,
885 0b_00010000,
886 0b_00010000,
887 0b_11111111,
888 0b_00010000,
889 0b_00010000,
890 0b_00010000,
891 0b_00010000,
892 /* 22 */
893 0b_00010000,
894 0b_00010000,
895 0b_00010000,
896 0b_00010000,
897 0b_00010000,
898 0b_00010000,
899 0b_00010000,
900 0b_00010000,
901 /* 23 */
902 0b_00000000,
903 0b_00000000,
904 0b_00000000,
905 0b_11111111,
906 0b_00000000,
907 0b_00000000,
908 0b_00000000,
909 0b_00000000,
910 /* 24 */
911 0b_00000000,
912 0b_00000000,
913 0b_00000000,
914 0b_00011111,
915 0b_00010000,
916 0b_00010000,
917 0b_00010000,
918 0b_00010000,
919 /* 25 */
920 0b_00000000,
921 0b_00000000,
922 0b_00000000,
923 0b_11110000,
924 0b_00010000,
925 0b_00010000,
926 0b_00010000,
927 0b_00010000,
928 /* 26 */
929 0b_00010000,
930 0b_00010000,
931 0b_00010000,
932 0b_00011111,
933 0b_00000000,
934 0b_00000000,
935 0b_00000000,
936 0b_00000000,
937 /* 27 */
938 0b_00010000,
939 0b_00010000,
940 0b_00010000,
941 0b_11110000,
942 0b_00000000,
943 0b_00000000,
944 0b_00000000,
945 0b_00000000,
946 /* 28 */
947 0b_10000001,
948 0b_01000010,
949 0b_00100100,
950 0b_00011000,
951 0b_00011000,
952 0b_00100100,
953 0b_01000010,
954 0b_10000001,
955 /* 29 */
956 0b_00000001,
957 0b_00000010,
958 0b_00000100,
959 0b_00001000,
960 0b_00010000,
961 0b_00100000,
962 0b_01000000,
963 0b_10000000,
964 /* 30 */
965 0b_10000000,
966 0b_01000000,
967 0b_00100000,
968 0b_00010000,
969 0b_00001000,
970 0b_00000100,
971 0b_00000010,
972 0b_00000001,
973 /* 31 */
974 0b_00000000,
975 0b_00010000,
976 0b_00010000,
977 0b_11111111,
978 0b_00010000,
979 0b_00010000,
980 0b_00000000,
981 0b_00000000,
982 /* 32 ' ' */
983 0b_00000000,
984 0b_00000000,
985 0b_00000000,
986 0b_00000000,
987 0b_00000000,
988 0b_00000000,
989 0b_00000000,
990 0b_00000000,
991 /* 33 '!' */
992 0b_00100000,
993 0b_00100000,
994 0b_00100000,
995 0b_00100000,
996 0b_00000000,
997 0b_00000000,
998 0b_00100000,
999 0b_00000000,
1000 /* 34 '"' */
1001 0b_01010000,
1002 0b_01010000,
1003 0b_01010000,
1004 0b_00000000,
1005 0b_00000000,
1006 0b_00000000,
1007 0b_00000000,
1008 0b_00000000,
1009 /* 35 '#' */
1010 0b_01010000,
1011 0b_01010000,
1012 0b_11111000,
1013 0b_01010000,
1014 0b_11111000,
1015 0b_01010000,
1016 0b_01010000,
1017 0b_00000000,
1018 /* 36 '$' */
1019 0b_00100000,
1020 0b_01111000,
1021 0b_10100000,
1022 0b_01110000,
1023 0b_00101000,
1024 0b_11110000,
1025 0b_00100000,
1026 0b_00000000,
1027 /* 37 '%' */
1028 0b_11000000,
1029 0b_11001000,
1030 0b_00010000,
1031 0b_00100000,
1032 0b_01000000,
1033 0b_10011000,
1034 0b_00011000,
1035 0b_00000000,
1036 /* 38 '&' */
1037 0b_01000000,
1038 0b_10100000,
1039 0b_01000000,
1040 0b_10101000,
1041 0b_10010000,
1042 0b_10011000,
1043 0b_01100000,
1044 0b_00000000,
1045 /* 39 ''' */
1046 0b_00010000,
1047 0b_00100000,
1048 0b_01000000,
1049 0b_00000000,
1050 0b_00000000,
1051 0b_00000000,
1052 0b_00000000,
1053 0b_00000000,
1054 /* 40 '(' */
1055 0b_00010000,
1056 0b_00100000,
1057 0b_01000000,
1058 0b_01000000,
1059 0b_01000000,
1060 0b_00100000,
1061 0b_00010000,
1062 0b_00000000,
1063 /* 41 ')' */
1064 0b_01000000,
1065 0b_00100000,
1066 0b_00010000,
1067 0b_00010000,
1068 0b_00010000,
1069 0b_00100000,
1070 0b_01000000,
1071 0b_00000000,
1072 /* 42 '*' */
1073 0b_10001000,
1074 0b_01010000,
1075 0b_00100000,
1076 0b_11111000,
1077 0b_00100000,
1078 0b_01010000,
1079 0b_10001000,
1080 0b_00000000,
1081 /* 43 '+' */
1082 0b_00000000,
1083 0b_00100000,
1084 0b_00100000,
1085 0b_11111000,
1086 0b_00100000,
1087 0b_00100000,
1088 0b_00000000,
1089 0b_00000000,
1090 /* 44 ',' */
1091 0b_00000000,
1092 0b_00000000,
1093 0b_00000000,
1094 0b_00000000,
1095 0b_00000000,
1096 0b_00100000,
1097 0b_00100000,
1098 0b_01000000,
1099 /* 45 '-' */
1100 0b_00000000,
1101 0b_00000000,
1102 0b_00000000,
1103 0b_01111000,
1104 0b_00000000,
1105 0b_00000000,
1106 0b_00000000,
1107 0b_00000000,
1108 /* 46 '.' */
1109 0b_00000000,
1110 0b_00000000,
1111 0b_00000000,
1112 0b_00000000,
1113 0b_00000000,
1114 0b_01100000,
1115 0b_01100000,
1116 0b_00000000,
1117 /* 47 '/' */
1118 0b_00000000,
1119 0b_00000000,
1120 0b_00001000,
1121 0b_00010000,
1122 0b_00100000,
1123 0b_01000000,
1124 0b_10000000,
1125 0b_00000000,
1126 /* 48 '0' */
1127 0b_01110000,
1128 0b_10001000,
1129 0b_10011000,
1130 0b_10101000,
1131 0b_11001000,
1132 0b_10001000,
1133 0b_01110000,
1134 0b_00000000,
1135 /* 49 '1' */
1136 0b_00100000,
1137 0b_01100000,
1138 0b_10100000,
1139 0b_00100000,
1140 0b_00100000,
1141 0b_00100000,
1142 0b_11111000,
1143 0b_00000000,
1144 /* 50 '2' */
1145 0b_01110000,
1146 0b_10001000,
1147 0b_00001000,
1148 0b_00010000,
1149 0b_01100000,
1150 0b_10000000,
1151 0b_11111000,
1152 0b_00000000,
1153 /* 51 '3' */
1154 0b_01110000,
1155 0b_10001000,
1156 0b_00001000,
1157 0b_00110000,
1158 0b_00001000,
1159 0b_10001000,
1160 0b_01110000,
1161 0b_00000000,
1162 /* 52 '4' */
1163 0b_00010000,
1164 0b_00110000,
1165 0b_01010000,
1166 0b_10010000,
1167 0b_11111000,
1168 0b_00010000,
1169 0b_00010000,
1170 0b_00000000,
1171 /* 53 '5' */
1172 0b_11111000,
1173 0b_10000000,
1174 0b_11100000,
1175 0b_00010000,
1176 0b_00001000,
1177 0b_00010000,
1178 0b_11100000,
1179 0b_00000000,
1180 /* 54 '6' */
1181 0b_00110000,
1182 0b_01000000,
1183 0b_10000000,
1184 0b_11110000,
1185 0b_10001000,
1186 0b_10001000,
1187 0b_01110000,
1188 0b_00000000,
1189 /* 55 '7' */
1190 0b_11111000,
1191 0b_10001000,
1192 0b_00010000,
1193 0b_00100000,
1194 0b_00100000,
1195 0b_00100000,
1196 0b_00100000,
1197 0b_00000000,
1198 /* 56 '8' */
1199 0b_01110000,
1200 0b_10001000,
1201 0b_10001000,
1202 0b_01110000,
1203 0b_10001000,
1204 0b_10001000,
1205 0b_01110000,
1206 0b_00000000,
1207 /* 57 '9' */
1208 0b_01110000,
1209 0b_10001000,
1210 0b_10001000,
1211 0b_01111000,
1212 0b_00001000,
1213 0b_00010000,
1214 0b_01100000,
1215 0b_00000000,
1216 /* 58 ':' */
1217 0b_00000000,
1218 0b_00000000,
1219 0b_00100000,
1220 0b_00000000,
1221 0b_00000000,
1222 0b_00100000,
1223 0b_00000000,
1224 0b_00000000,
1225 /* 59 ';' */
1226 0b_00000000,
1227 0b_00000000,
1228 0b_00100000,
1229 0b_00000000,
1230 0b_00000000,
1231 0b_00100000,
1232 0b_00100000,
1233 0b_01000000,
1234 /* 60 '<' */
1235 0b_00011000,
1236 0b_00110000,
1237 0b_01100000,
1238 0b_11000000,
1239 0b_01100000,
1240 0b_00110000,
1241 0b_00011000,
1242 0b_00000000,
1243 /* 61 '=' */
1244 0b_00000000,
1245 0b_00000000,
1246 0b_11111000,
1247 0b_00000000,
1248 0b_11111000,
1249 0b_00000000,
1250 0b_00000000,
1251 0b_00000000,
1252 /* 62 '>' */
1253 0b_11000000,
1254 0b_01100000,
1255 0b_00110000,
1256 0b_00011000,
1257 0b_00110000,
1258 0b_01100000,
1259 0b_11000000,
1260 0b_00000000,
1261 /* 63 '?' */
1262 0b_01110000,
1263 0b_10001000,
1264 0b_00001000,
1265 0b_00010000,
1266 0b_00100000,
1267 0b_00000000,
1268 0b_00100000,
1269 0b_00000000,
1270 /* 64 '@' */
1271 0b_01110000,
1272 0b_10001000,
1273 0b_00001000,
1274 0b_01101000,
1275 0b_10101000,
1276 0b_10101000,
1277 0b_01110000,
1278 0b_00000000,
1279 /* 65 'A' */
1280 0b_00100000,
1281 0b_01010000,
1282 0b_10001000,
1283 0b_10001000,
1284 0b_11111000,
1285 0b_10001000,
1286 0b_10001000,
1287 0b_00000000,
1288 /* 66 'B' */
1289 0b_11110000,
1290 0b_01001000,
1291 0b_01001000,
1292 0b_01110000,
1293 0b_01001000,
1294 0b_01001000,
1295 0b_11110000,
1296 0b_00000000,
1297 /* 67 'C' */
1298 0b_00110000,
1299 0b_01001000,
1300 0b_10000000,
1301 0b_10000000,
1302 0b_10000000,
1303 0b_01001000,
1304 0b_00110000,
1305 0b_00000000,
1306 /* 68 'D' */
1307 0b_11100000,
1308 0b_01010000,
1309 0b_01001000,
1310 0b_01001000,
1311 0b_01001000,
1312 0b_01010000,
1313 0b_11100000,
1314 0b_00000000,
1315 /* 69 'E' */
1316 0b_11111000,
1317 0b_10000000,
1318 0b_10000000,
1319 0b_11110000,
1320 0b_10000000,
1321 0b_10000000,
1322 0b_11111000,
1323 0b_00000000,
1324 /* 70 'F' */
1325 0b_11111000,
1326 0b_10000000,
1327 0b_10000000,
1328 0b_11110000,
1329 0b_10000000,
1330 0b_10000000,
1331 0b_10000000,
1332 0b_00000000,
1333 /* 71 'G' */
1334 0b_01110000,
1335 0b_10001000,
1336 0b_10000000,
1337 0b_10111000,
1338 0b_10001000,
1339 0b_10001000,
1340 0b_01110000,
1341 0b_00000000,
1342 /* 72 'H' */
1343 0b_10001000,
1344 0b_10001000,
1345 0b_10001000,
1346 0b_11111000,
1347 0b_10001000,
1348 0b_10001000,
1349 0b_10001000,
1350 0b_00000000,
1351 /* 73 'I' */
1352 0b_01110000,
1353 0b_00100000,
1354 0b_00100000,
1355 0b_00100000,
1356 0b_00100000,
1357 0b_00100000,
1358 0b_01110000,
1359 0b_00000000,
1360 /* 74 'J' */
1361 0b_00111000,
1362 0b_00010000,
1363 0b_00010000,
1364 0b_00010000,
1365 0b_10010000,
1366 0b_10010000,
1367 0b_01100000,
1368 0b_00000000,
1369 /* 75 'K' */
1370 0b_10001000,
1371 0b_10010000,
1372 0b_10100000,
1373 0b_11000000,
1374 0b_10100000,
1375 0b_10010000,
1376 0b_10001000,
1377 0b_00000000,
1378 /* 76 'L' */
1379 0b_10000000,
1380 0b_10000000,
1381 0b_10000000,
1382 0b_10000000,
1383 0b_10000000,
1384 0b_10000000,
1385 0b_11111000,
1386 0b_00000000,
1387 /* 77 'M' */
1388 0b_10001000,
1389 0b_11011000,
1390 0b_10101000,
1391 0b_10101000,
1392 0b_10001000,
1393 0b_10001000,
1394 0b_10001000,
1395 0b_00000000,
1396 /* 78 'N' */
1397 0b_10001000,
1398 0b_11001000,
1399 0b_11001000,
1400 0b_10101000,
1401 0b_10011000,
1402 0b_10011000,
1403 0b_10001000,
1404 0b_00000000,
1405 /* 79 'O' */
1406 0b_01110000,
1407 0b_10001000,
1408 0b_10001000,
1409 0b_10001000,
1410 0b_10001000,
1411 0b_10001000,
1412 0b_01110000,
1413 0b_00000000,
1414 /* 80 'P' */
1415 0b_11110000,
1416 0b_10001000,
1417 0b_10001000,
1418 0b_11110000,
1419 0b_10000000,
1420 0b_10000000,
1421 0b_10000000,
1422 0b_00000000,
1423 /* 81 'Q' */
1424 0b_01110000,
1425 0b_10001000,
1426 0b_10001000,
1427 0b_10001000,
1428 0b_10101000,
1429 0b_10010000,
1430 0b_01101000,
1431 0b_00000000,
1432 /* 82 'R' */
1433 0b_11110000,
1434 0b_10001000,
1435 0b_10001000,
1436 0b_11110000,
1437 0b_10100000,
1438 0b_10010000,
1439 0b_10001000,
1440 0b_00000000,
1441 /* 83 'S' */
1442 0b_01110000,
1443 0b_10001000,
1444 0b_10000000,
1445 0b_01110000,
1446 0b_00001000,
1447 0b_10001000,
1448 0b_01110000,
1449 0b_00000000,
1450 /* 84 'T' */
1451 0b_11111000,
1452 0b_00100000,
1453 0b_00100000,
1454 0b_00100000,
1455 0b_00100000,
1456 0b_00100000,
1457 0b_00100000,
1458 0b_00000000,
1459 /* 85 'U' */
1460 0b_10001000,
1461 0b_10001000,
1462 0b_10001000,
1463 0b_10001000,
1464 0b_10001000,
1465 0b_10001000,
1466 0b_01110000,
1467 0b_00000000,
1468 /* 86 'V' */
1469 0b_10001000,
1470 0b_10001000,
1471 0b_10001000,
1472 0b_10001000,
1473 0b_01010000,
1474 0b_01010000,
1475 0b_00100000,
1476 0b_00000000,
1477 /* 87 'W' */
1478 0b_10001000,
1479 0b_10001000,
1480 0b_10001000,
1481 0b_10101000,
1482 0b_10101000,
1483 0b_11011000,
1484 0b_10001000,
1485 0b_00000000,
1486 /* 88 'X' */
1487 0b_10001000,
1488 0b_10001000,
1489 0b_01010000,
1490 0b_00100000,
1491 0b_01010000,
1492 0b_10001000,
1493 0b_10001000,
1494 0b_00000000,
1495 /* 89 'Y' */
1496 0b_10001000,
1497 0b_10001000,
1498 0b_10001000,
1499 0b_01110000,
1500 0b_00100000,
1501 0b_00100000,
1502 0b_00100000,
1503 0b_00000000,
1504 /* 90 'Z' */
1505 0b_11111000,
1506 0b_00001000,
1507 0b_00010000,
1508 0b_00100000,
1509 0b_01000000,
1510 0b_10000000,
1511 0b_11111000,
1512 0b_00000000,
1513 /* 91 '[' */
1514 0b_01110000,
1515 0b_01000000,
1516 0b_01000000,
1517 0b_01000000,
1518 0b_01000000,
1519 0b_01000000,
1520 0b_01110000,
1521 0b_00000000,
1522 /* 92 '\' */
1523 0b_00000000,
1524 0b_00000000,
1525 0b_10000000,
1526 0b_01000000,
1527 0b_00100000,
1528 0b_00010000,
1529 0b_00001000,
1530 0b_00000000,
1531 /* 93 ']' */
1532 0b_01110000,
1533 0b_00010000,
1534 0b_00010000,
1535 0b_00010000,
1536 0b_00010000,
1537 0b_00010000,
1538 0b_01110000,
1539 0b_00000000,
1540 /* 94 '^' */
1541 0b_00100000,
1542 0b_01010000,
1543 0b_10001000,
1544 0b_00000000,
1545 0b_00000000,
1546 0b_00000000,
1547 0b_00000000,
1548 0b_00000000,
1549 /* 95 '_' */
1550 0b_00000000,
1551 0b_00000000,
1552 0b_00000000,
1553 0b_00000000,
1554 0b_00000000,
1555 0b_00000000,
1556 0b_11111000,
1557 0b_00000000,
1558 /* 96 '`' */
1559 0b_01000000,
1560 0b_00100000,
1561 0b_00010000,
1562 0b_00000000,
1563 0b_00000000,
1564 0b_00000000,
1565 0b_00000000,
1566 0b_00000000,
1567 /* 97 'a' */
1568 0b_00000000,
1569 0b_00000000,
1570 0b_01110000,
1571 0b_00001000,
1572 0b_01111000,
1573 0b_10001000,
1574 0b_01111000,
1575 0b_00000000,
1576 /* 98 'b' */
1577 0b_10000000,
1578 0b_10000000,
1579 0b_10110000,
1580 0b_11001000,
1581 0b_10001000,
1582 0b_11001000,
1583 0b_10110000,
1584 0b_00000000,
1585 /* 99 'c' */
1586 0b_00000000,
1587 0b_00000000,
1588 0b_01110000,
1589 0b_10001000,
1590 0b_10000000,
1591 0b_10001000,
1592 0b_01110000,
1593 0b_00000000,
1594 /* 100 'd' */
1595 0b_00001000,
1596 0b_00001000,
1597 0b_01101000,
1598 0b_10011000,
1599 0b_10001000,
1600 0b_10011000,
1601 0b_01101000,
1602 0b_00000000,
1603 /* 101 'e' */
1604 0b_00000000,
1605 0b_00000000,
1606 0b_01110000,
1607 0b_10001000,
1608 0b_11111000,
1609 0b_10000000,
1610 0b_01110000,
1611 0b_00000000,
1612 /* 102 'f' */
1613 0b_00010000,
1614 0b_00101000,
1615 0b_00100000,
1616 0b_11111000,
1617 0b_00100000,
1618 0b_00100000,
1619 0b_00100000,
1620 0b_00000000,
1621 /* 103 'g' */
1622 0b_00000000,
1623 0b_00000000,
1624 0b_01101000,
1625 0b_10011000,
1626 0b_10011000,
1627 0b_01101000,
1628 0b_00001000,
1629 0b_01110000,
1630 /* 104 'h' */
1631 0b_10000000,
1632 0b_10000000,
1633 0b_11110000,
1634 0b_10001000,
1635 0b_10001000,
1636 0b_10001000,
1637 0b_10001000,
1638 0b_00000000,
1639 /* 105 'i' */
1640 0b_00100000,
1641 0b_00000000,
1642 0b_01100000,
1643 0b_00100000,
1644 0b_00100000,
1645 0b_00100000,
1646 0b_01110000,
1647 0b_00000000,
1648 /* 106 'j' */
1649 0b_00010000,
1650 0b_00000000,
1651 0b_00110000,
1652 0b_00010000,
1653 0b_00010000,
1654 0b_00010000,
1655 0b_10010000,
1656 0b_01100000,
1657 /* 107 'k' */
1658 0b_01000000,
1659 0b_01000000,
1660 0b_01001000,
1661 0b_01010000,
1662 0b_01100000,
1663 0b_01010000,
1664 0b_01001000,
1665 0b_00000000,
1666 /* 108 'l' */
1667 0b_01100000,
1668 0b_00100000,
1669 0b_00100000,
1670 0b_00100000,
1671 0b_00100000,
1672 0b_00100000,
1673 0b_01110000,
1674 0b_00000000,
1675 /* 109 'm' */
1676 0b_00000000,
1677 0b_00000000,
1678 0b_11010000,
1679 0b_10101000,
1680 0b_10101000,
1681 0b_10101000,
1682 0b_10101000,
1683 0b_00000000,
1684 /* 110 'n' */
1685 0b_00000000,
1686 0b_00000000,
1687 0b_10110000,
1688 0b_11001000,
1689 0b_10001000,
1690 0b_10001000,
1691 0b_10001000,
1692 0b_00000000,
1693 /* 111 'o' */
1694 0b_00000000,
1695 0b_00000000,
1696 0b_01110000,
1697 0b_10001000,
1698 0b_10001000,
1699 0b_10001000,
1700 0b_01110000,
1701 0b_00000000,
1702 /* 112 'p' */
1703 0b_00000000,
1704 0b_00000000,
1705 0b_10110000,
1706 0b_11001000,
1707 0b_11001000,
1708 0b_10110000,
1709 0b_10000000,
1710 0b_10000000,
1711 /* 113 'q' */
1712 0b_00000000,
1713 0b_00000000,
1714 0b_01101000,
1715 0b_10011000,
1716 0b_10011000,
1717 0b_01101000,
1718 0b_00001000,
1719 0b_00001000,
1720 /* 114 'r' */
1721 0b_00000000,
1722 0b_00000000,
1723 0b_10110000,
1724 0b_11001000,
1725 0b_10000000,
1726 0b_10000000,
1727 0b_10000000,
1728 0b_00000000,
1729 /* 115 's' */
1730 0b_00000000,
1731 0b_00000000,
1732 0b_01111000,
1733 0b_10000000,
1734 0b_11110000,
1735 0b_00001000,
1736 0b_11110000,
1737 0b_00000000,
1738 /* 116 't' */
1739 0b_01000000,
1740 0b_01000000,
1741 0b_11110000,
1742 0b_01000000,
1743 0b_01000000,
1744 0b_01001000,
1745 0b_00110000,
1746 0b_00000000,
1747 /* 117 'u' */
1748 0b_00000000,
1749 0b_00000000,
1750 0b_10010000,
1751 0b_10010000,
1752 0b_10010000,
1753 0b_10010000,
1754 0b_01101000,
1755 0b_00000000,
1756 /* 118 'v' */
1757 0b_00000000,
1758 0b_00000000,
1759 0b_10001000,
1760 0b_10001000,
1761 0b_10001000,
1762 0b_01010000,
1763 0b_00100000,
1764 0b_00000000,
1765 /* 119 'w' */
1766 0b_00000000,
1767 0b_00000000,
1768 0b_10001000,
1769 0b_10101000,
1770 0b_10101000,
1771 0b_10101000,
1772 0b_01010000,
1773 0b_00000000,
1774 /* 120 'x' */
1775 0b_00000000,
1776 0b_00000000,
1777 0b_10001000,
1778 0b_01010000,
1779 0b_00100000,
1780 0b_01010000,
1781 0b_10001000,
1782 0b_00000000,
1783 /* 121 'y' */
1784 0b_00000000,
1785 0b_00000000,
1786 0b_10001000,
1787 0b_10001000,
1788 0b_10011000,
1789 0b_01101000,
1790 0b_00001000,
1791 0b_01110000,
1792 /* 122 'z' */
1793 0b_00000000,
1794 0b_00000000,
1795 0b_11111000,
1796 0b_00010000,
1797 0b_00100000,
1798 0b_01000000,
1799 0b_11111000,
1800 0b_00000000,
1801 /* 123 '{' */
1802 0b_00011000,
1803 0b_00100000,
1804 0b_00100000,
1805 0b_01000000,
1806 0b_00100000,
1807 0b_00100000,
1808 0b_00011000,
1809 0b_00000000,
1810 /* 124 '|' */
1811 0b_00100000,
1812 0b_00100000,
1813 0b_00100000,
1814 0b_00000000,
1815 0b_00100000,
1816 0b_00100000,
1817 0b_00100000,
1818 0b_00000000,
1819 /* 125 '}' */
1820 0b_11000000,
1821 0b_00100000,
1822 0b_00100000,
1823 0b_00010000,
1824 0b_00100000,
1825 0b_00100000,
1826 0b_11000000,
1827 0b_00000000,
1828 /* 126 '~' */
1829 0b_01000000,
1830 0b_10101000,
1831 0b_00010000,
1832 0b_00000000,
1833 0b_00000000,
1834 0b_00000000,
1835 0b_00000000,
1836 0b_00000000,
1837 /* 127 */
1838 0b_00000000,
1839 0b_00000000,
1840 0b_00100000,
1841 0b_01010000,
1842 0b_11111000,
1843 0b_00000000,
1844 0b_00000000,
1845 0b_00000000,
1846 /* 128 */
1847 0b_00000000,
1848 0b_00000000,
1849 0b_00000000,
1850 0b_00000000,
1851 0b_00000000,
1852 0b_00000000,
1853 0b_11111111,
1854 0b_11111111,
1855 /* 129 */
1856 0b_11110000,
1857 0b_11110000,
1858 0b_11110000,
1859 0b_11110000,
1860 0b_00001111,
1861 0b_00001111,
1862 0b_00001111,
1863 0b_00001111,
1864 /* 130 */
1865 0b_00000000,
1866 0b_00000000,
1867 0b_11111111,
1868 0b_11111111,
1869 0b_11111111,
1870 0b_11111111,
1871 0b_11111111,
1872 0b_11111111,
1873 /* 131 */
1874 0b_11111111,
1875 0b_11111111,
1876 0b_00000000,
1877 0b_00000000,
1878 0b_00000000,
1879 0b_00000000,
1880 0b_00000000,
1881 0b_00000000,
1882 /* 132 */
1883 0b_00000000,
1884 0b_00000000,
1885 0b_00000000,
1886 0b_00111100,
1887 0b_00111100,
1888 0b_00000000,
1889 0b_00000000,
1890 0b_00000000,
1891 /* 133 */
1892 0b_11111111,
1893 0b_11111111,
1894 0b_11111111,
1895 0b_11111111,
1896 0b_11111111,
1897 0b_11111111,
1898 0b_00000000,
1899 0b_00000000,
1900 /* 134 */
1901 0b_11000000,
1902 0b_11000000,
1903 0b_11000000,
1904 0b_11000000,
1905 0b_11000000,
1906 0b_11000000,
1907 0b_11000000,
1908 0b_11000000,
1909 /* 135 */
1910 0b_00001111,
1911 0b_00001111,
1912 0b_00001111,
1913 0b_00001111,
1914 0b_11110000,
1915 0b_11110000,
1916 0b_11110000,
1917 0b_11110000,
1918 /* 136 */
1919 0b_11111100,
1920 0b_11111100,
1921 0b_11111100,
1922 0b_11111100,
1923 0b_11111100,
1924 0b_11111100,
1925 0b_11111100,
1926 0b_11111100,
1927 /* 137 */
1928 0b_00000011,
1929 0b_00000011,
1930 0b_00000011,
1931 0b_00000011,
1932 0b_00000011,
1933 0b_00000011,
1934 0b_00000011,
1935 0b_00000011,
1936 /* 138 */
1937 0b_00111111,
1938 0b_00111111,
1939 0b_00111111,
1940 0b_00111111,
1941 0b_00111111,
1942 0b_00111111,
1943 0b_00111111,
1944 0b_00111111,
1945 /* 139 */
1946 0b_00010001,
1947 0b_00100010,
1948 0b_01000100,
1949 0b_10001000,
1950 0b_00010001,
1951 0b_00100010,
1952 0b_01000100,
1953 0b_10001000,
1954 /* 140 */
1955 0b_10001000,
1956 0b_01000100,
1957 0b_00100010,
1958 0b_00010001,
1959 0b_10001000,
1960 0b_01000100,
1961 0b_00100010,
1962 0b_00010001,
1963 /* 141 */
1964 0b_11111110,
1965 0b_01111100,
1966 0b_00111000,
1967 0b_00010000,
1968 0b_00000000,
1969 0b_00000000,
1970 0b_00000000,
1971 0b_00000000,
1972 /* 142 */
1973 0b_00000000,
1974 0b_00000000,
1975 0b_00000000,
1976 0b_00000000,
1977 0b_00010000,
1978 0b_00111000,
1979 0b_01111100,
1980 0b_11111110,
1981 /* 143 */
1982 0b_10000000,
1983 0b_11000000,
1984 0b_11100000,
1985 0b_11110000,
1986 0b_11100000,
1987 0b_11000000,
1988 0b_10000000,
1989 0b_00000000,
1990 /* 144 */
1991 0b_00000001,
1992 0b_00000011,
1993 0b_00000111,
1994 0b_00001111,
1995 0b_00000111,
1996 0b_00000011,
1997 0b_00000001,
1998 0b_00000000,
1999 /* 145 */
2000 0b_11111111,
2001 0b_01111110,
2002 0b_00111100,
2003 0b_00011000,
2004 0b_00011000,
2005 0b_00111100,
2006 0b_01111110,
2007 0b_11111111,
2008 /* 146 */
2009 0b_10000001,
2010 0b_11000011,
2011 0b_11100111,
2012 0b_11111111,
2013 0b_11111111,
2014 0b_11100111,
2015 0b_11000011,
2016 0b_10000001,
2017 /* 147 */
2018 0b_11110000,
2019 0b_11110000,
2020 0b_11110000,
2021 0b_11110000,
2022 0b_00000000,
2023 0b_00000000,
2024 0b_00000000,
2025 0b_00000000,
2026 /* 148 */
2027 0b_00000000,
2028 0b_00000000,
2029 0b_00000000,
2030 0b_00000000,
2031 0b_00001111,
2032 0b_00001111,
2033 0b_00001111,
2034 0b_00001111,
2035 /* 149 */
2036 0b_00001111,
2037 0b_00001111,
2038 0b_00001111,
2039 0b_00001111,
2040 0b_00000000,
2041 0b_00000000,
2042 0b_00000000,
2043 0b_00000000,
2044 /* 150 */
2045 0b_00000000,
2046 0b_00000000,
2047 0b_00000000,
2048 0b_00000000,
2049 0b_11110000,
2050 0b_11110000,
2051 0b_11110000,
2052 0b_11110000,
2053 /* 151 */
2054 0b_00110011,
2055 0b_00110011,
2056 0b_11001100,
2057 0b_11001100,
2058 0b_00110011,
2059 0b_00110011,
2060 0b_11001100,
2061 0b_11001100,
2062 /* 152 */
2063 0b_00000000,
2064 0b_00100000,
2065 0b_00100000,
2066 0b_01010000,
2067 0b_01010000,
2068 0b_10001000,
2069 0b_11111000,
2070 0b_00000000,
2071 /* 153 */
2072 0b_00100000,
2073 0b_00100000,
2074 0b_01110000,
2075 0b_00100000,
2076 0b_01110000,
2077 0b_00100000,
2078 0b_00100000,
2079 0b_00000000,
2080 /* 154 */
2081 0b_00000000,
2082 0b_00000000,
2083 0b_00000000,
2084 0b_01010000,
2085 0b_10001000,
2086 0b_10101000,
2087 0b_01010000,
2088 0b_00000000,
2089 /* 155 */
2090 0b_11111111,
2091 0b_11111111,
2092 0b_11111111,
2093 0b_11111111,
2094 0b_11111111,
2095 0b_11111111,
2096 0b_11111111,
2097 0b_11111111,
2098 /* 156 */
2099 0b_00000000,
2100 0b_00000000,
2101 0b_00000000,
2102 0b_00000000,
2103 0b_11111111,
2104 0b_11111111,
2105 0b_11111111,
2106 0b_11111111,
2107 /* 157 */
2108 0b_11110000,
2109 0b_11110000,
2110 0b_11110000,
2111 0b_11110000,
2112 0b_11110000,
2113 0b_11110000,
2114 0b_11110000,
2115 0b_11110000,
2116 /* 158 */
2117 0b_00001111,
2118 0b_00001111,
2119 0b_00001111,
2120 0b_00001111,
2121 0b_00001111,
2122 0b_00001111,
2123 0b_00001111,
2124 0b_00001111,
2125 /* 159 */
2126 0b_11111111,
2127 0b_11111111,
2128 0b_11111111,
2129 0b_11111111,
2130 0b_00000000,
2131 0b_00000000,
2132 0b_00000000,
2133 0b_00000000,
2134 /* 160 */
2135 0b_00000000,
2136 0b_00000000,
2137 0b_01101000,
2138 0b_10010000,
2139 0b_10010000,
2140 0b_10010000,
2141 0b_01101000,
2142 0b_00000000,
2143 /* 161 */
2144 0b_00110000,
2145 0b_01001000,
2146 0b_01001000,
2147 0b_01110000,
2148 0b_01001000,
2149 0b_01001000,
2150 0b_01110000,
2151 0b_11000000,
2152 /* 162 */
2153 0b_11111000,
2154 0b_10001000,
2155 0b_10000000,
2156 0b_10000000,
2157 0b_10000000,
2158 0b_10000000,
2159 0b_10000000,
2160 0b_00000000,
2161 /* 163 */
2162 0b_00000000,
2163 0b_01010000,
2164 0b_01110000,
2165 0b_10001000,
2166 0b_11111000,
2167 0b_10000000,
2168 0b_01110000,
2169 0b_00000000,
2170 /* 164 */
2171 0b_00000000,
2172 0b_00000000,
2173 0b_01111000,
2174 0b_10000000,
2175 0b_11110000,
2176 0b_10000000,
2177 0b_01111000,
2178 0b_00000000,
2179 /* 165 */
2180 0b_00000000,
2181 0b_00000000,
2182 0b_01111000,
2183 0b_10010000,
2184 0b_10010000,
2185 0b_10010000,
2186 0b_01100000,
2187 0b_00000000,
2188 /* 166 */
2189 0b_00100000,
2190 0b_00000000,
2191 0b_01100000,
2192 0b_00100000,
2193 0b_00100000,
2194 0b_00100000,
2195 0b_01110000,
2196 0b_00000000,
2197 /* 167 */
2198 0b_01010000,
2199 0b_00000000,
2200 0b_01110000,
2201 0b_00100000,
2202 0b_00100000,
2203 0b_00100000,
2204 0b_01110000,
2205 0b_00000000,
2206 /* 168 */
2207 0b_11111000,
2208 0b_00100000,
2209 0b_01110000,
2210 0b_10101000,
2211 0b_10101000,
2212 0b_01110000,
2213 0b_00100000,
2214 0b_11111000,
2215 /* 169 */
2216 0b_00100000,
2217 0b_01010000,
2218 0b_10001000,
2219 0b_11111000,
2220 0b_10001000,
2221 0b_01010000,
2222 0b_00100000,
2223 0b_00000000,
2224 /* 170 */
2225 0b_01110000,
2226 0b_10001000,
2227 0b_10001000,
2228 0b_10001000,
2229 0b_01010000,
2230 0b_01010000,
2231 0b_11011000,
2232 0b_00000000,
2233 /* 171 */
2234 0b_00110000,
2235 0b_01000000,
2236 0b_01000000,
2237 0b_00100000,
2238 0b_01010000,
2239 0b_01010000,
2240 0b_01010000,
2241 0b_00100000,
2242 /* 172 */
2243 0b_00000000,
2244 0b_00000000,
2245 0b_00000000,
2246 0b_01010000,
2247 0b_10101000,
2248 0b_10101000,
2249 0b_01010000,
2250 0b_00000000,
2251 /* 173 */
2252 0b_00001000,
2253 0b_01110000,
2254 0b_10101000,
2255 0b_10101000,
2256 0b_10101000,
2257 0b_01110000,
2258 0b_10000000,
2259 0b_00000000,
2260 /* 174 */
2261 0b_00111000,
2262 0b_01000000,
2263 0b_10000000,
2264 0b_11111000,
2265 0b_10000000,
2266 0b_01000000,
2267 0b_00111000,
2268 0b_00000000,
2269 /* 175 */
2270 0b_01110000,
2271 0b_10001000,
2272 0b_10001000,
2273 0b_10001000,
2274 0b_10001000,
2275 0b_10001000,
2276 0b_10001000,
2277 0b_00000000,
2278 /* 176 */
2279 0b_00000000,
2280 0b_11111000,
2281 0b_00000000,
2282 0b_11111000,
2283 0b_00000000,
2284 0b_11111000,
2285 0b_00000000,
2286 0b_00000000,
2287 /* 177 */
2288 0b_00100000,
2289 0b_00100000,
2290 0b_11111000,
2291 0b_00100000,
2292 0b_00100000,
2293 0b_00000000,
2294 0b_11111000,
2295 0b_00000000,
2296 /* 178 */
2297 0b_11000000,
2298 0b_00110000,
2299 0b_00001000,
2300 0b_00110000,
2301 0b_11000000,
2302 0b_00000000,
2303 0b_11111000,
2304 0b_00000000,
2305 /* 179 */
2306 0b_01010000,
2307 0b_11111000,
2308 0b_10000000,
2309 0b_11110000,
2310 0b_10000000,
2311 0b_10000000,
2312 0b_11111000,
2313 0b_00000000,
2314 /* 180 */
2315 0b_01111000,
2316 0b_10000000,
2317 0b_10000000,
2318 0b_11110000,
2319 0b_10000000,
2320 0b_10000000,
2321 0b_01111000,
2322 0b_00000000,
2323 /* 181 */
2324 0b_00100000,
2325 0b_00100000,
2326 0b_00100000,
2327 0b_00100000,
2328 0b_00100000,
2329 0b_00100000,
2330 0b_10100000,
2331 0b_01000000,
2332 /* 182 */
2333 0b_01110000,
2334 0b_00100000,
2335 0b_00100000,
2336 0b_00100000,
2337 0b_00100000,
2338 0b_00100000,
2339 0b_01110000,
2340 0b_00000000,
2341 /* 183 */
2342 0b_01010000,
2343 0b_01110000,
2344 0b_00100000,
2345 0b_00100000,
2346 0b_00100000,
2347 0b_00100000,
2348 0b_01110000,
2349 0b_00000000,
2350 /* 184 */
2351 0b_00000000,
2352 0b_00011000,
2353 0b_00100100,
2354 0b_00100100,
2355 0b_00011000,
2356 0b_00000000,
2357 0b_00000000,
2358 0b_00000000,
2359 /* 185 */
2360 0b_00000000,
2361 0b_00110000,
2362 0b_01111000,
2363 0b_01111000,
2364 0b_00110000,
2365 0b_00000000,
2366 0b_00000000,
2367 0b_00000000,
2368 /* 186 */
2369 0b_00000000,
2370 0b_00000000,
2371 0b_00000000,
2372 0b_00000000,
2373 0b_00110000,
2374 0b_00000000,
2375 0b_00000000,
2376 0b_00000000,
2377 /* 187 */
2378 0b_00111110,
2379 0b_00100000,
2380 0b_00100000,
2381 0b_00100000,
2382 0b_10100000,
2383 0b_01100000,
2384 0b_00100000,
2385 0b_00000000,
2386 /* 188 */
2387 0b_10100000,
2388 0b_01010000,
2389 0b_01010000,
2390 0b_01010000,
2391 0b_00000000,
2392 0b_00000000,
2393 0b_00000000,
2394 0b_00000000,
2395 /* 189 */
2396 0b_01000000,
2397 0b_10100000,
2398 0b_00100000,
2399 0b_01000000,
2400 0b_11100000,
2401 0b_00000000,
2402 0b_00000000,
2403 0b_00000000,
2404 /* 190 */
2405 0b_00000000,
2406 0b_00111000,
2407 0b_00111000,
2408 0b_00111000,
2409 0b_00111000,
2410 0b_00111000,
2411 0b_00111000,
2412 0b_00000000,
2413 /* 191 */
2414 0b_00111100,
2415 0b_01000010,
2416 0b_10011001,
2417 0b_10100001,
2418 0b_10100001,
2419 0b_10011001,
2420 0b_01000010,
2421 0b_00111100,
2422 /* 192 */
2423 0b_00000000,
2424 0b_00000000,
2425 0b_10010000,
2426 0b_10101000,
2427 0b_11101000,
2428 0b_10101000,
2429 0b_10010000,
2430 0b_00000000,
2431 /* 193 */
2432 0b_00000000,
2433 0b_00000000,
2434 0b_01100000,
2435 0b_00010000,
2436 0b_01110000,
2437 0b_10010000,
2438 0b_01101000,
2439 0b_00000000,
2440 /* 194 */
2441 0b_00000000,
2442 0b_00000000,
2443 0b_11110000,
2444 0b_10000000,
2445 0b_11110000,
2446 0b_10001000,
2447 0b_11110000,
2448 0b_00000000,
2449 /* 195 */
2450 0b_00000000,
2451 0b_00000000,
2452 0b_10010000,
2453 0b_10010000,
2454 0b_10010000,
2455 0b_11111000,
2456 0b_00001000,
2457 0b_00000000,
2458 /* 196 */
2459 0b_00000000,
2460 0b_00000000,
2461 0b_00110000,
2462 0b_01010000,
2463 0b_01010000,
2464 0b_01110000,
2465 0b_10001000,
2466 0b_00000000,
2467 /* 197 */
2468 0b_00000000,
2469 0b_00000000,
2470 0b_01110000,
2471 0b_10001000,
2472 0b_11111000,
2473 0b_10000000,
2474 0b_01110000,
2475 0b_00000000,
2476 /* 198 */
2477 0b_00000000,
2478 0b_00100000,
2479 0b_01110000,
2480 0b_10101000,
2481 0b_10101000,
2482 0b_01110000,
2483 0b_00100000,
2484 0b_00000000,
2485 /* 199 */
2486 0b_00000000,
2487 0b_00000000,
2488 0b_01111000,
2489 0b_01001000,
2490 0b_01000000,
2491 0b_01000000,
2492 0b_01000000,
2493 0b_00000000,
2494 /* 200 */
2495 0b_00000000,
2496 0b_00000000,
2497 0b_10001000,
2498 0b_01010000,
2499 0b_00100000,
2500 0b_01010000,
2501 0b_10001000,
2502 0b_00000000,
2503 /* 201 */
2504 0b_00000000,
2505 0b_00000000,
2506 0b_10001000,
2507 0b_10011000,
2508 0b_10101000,
2509 0b_11001000,
2510 0b_10001000,
2511 0b_00000000,
2512 /* 202 */
2513 0b_00000000,
2514 0b_01010000,
2515 0b_00100000,
2516 0b_00000000,
2517 0b_10011000,
2518 0b_10101000,
2519 0b_11001000,
2520 0b_00000000,
2521 /* 203 */
2522 0b_00000000,
2523 0b_00000000,
2524 0b_10010000,
2525 0b_10100000,
2526 0b_11000000,
2527 0b_10100000,
2528 0b_10010000,
2529 0b_00000000,
2530 /* 204 */
2531 0b_00000000,
2532 0b_00000000,
2533 0b_00111000,
2534 0b_00101000,
2535 0b_00101000,
2536 0b_01001000,
2537 0b_10001000,
2538 0b_00000000,
2539 /* 205 */
2540 0b_00000000,
2541 0b_00000000,
2542 0b_10001000,
2543 0b_11011000,
2544 0b_10101000,
2545 0b_10001000,
2546 0b_10001000,
2547 0b_00000000,
2548 /* 206 */
2549 0b_00000000,
2550 0b_00000000,
2551 0b_10001000,
2552 0b_10001000,
2553 0b_11111000,
2554 0b_10001000,
2555 0b_10001000,
2556 0b_00000000,
2557 /* 207 */
2558 0b_00000000,
2559 0b_00000000,
2560 0b_01110000,
2561 0b_10001000,
2562 0b_10001000,
2563 0b_10001000,
2564 0b_01110000,
2565 0b_00000000,
2566 /* 208 */
2567 0b_00000000,
2568 0b_00000000,
2569 0b_01111000,
2570 0b_01001000,
2571 0b_01001000,
2572 0b_01001000,
2573 0b_01001000,
2574 0b_00000000,
2575 /* 209 */
2576 0b_00000000,
2577 0b_00000000,
2578 0b_01111000,
2579 0b_10001000,
2580 0b_01111000,
2581 0b_00101000,
2582 0b_01001000,
2583 0b_00000000,
2584 /* 210 */
2585 0b_00000000,
2586 0b_00000000,
2587 0b_11110000,
2588 0b_10001000,
2589 0b_11110000,
2590 0b_10000000,
2591 0b_10000000,
2592 0b_00000000,
2593 /* 211 */
2594 0b_00000000,
2595 0b_00000000,
2596 0b_01111000,
2597 0b_10000000,
2598 0b_10000000,
2599 0b_10000000,
2600 0b_01111000,
2601 0b_00000000,
2602 /* 212 */
2603 0b_00000000,
2604 0b_00000000,
2605 0b_11111000,
2606 0b_00100000,
2607 0b_00100000,
2608 0b_00100000,
2609 0b_00100000,
2610 0b_00000000,
2611 /* 213 */
2612 0b_00000000,
2613 0b_00000000,
2614 0b_10001000,
2615 0b_01010000,
2616 0b_00100000,
2617 0b_01000000,
2618 0b_10000000,
2619 0b_00000000,
2620 /* 214 */
2621 0b_00000000,
2622 0b_00000000,
2623 0b_10101000,
2624 0b_01110000,
2625 0b_00100000,
2626 0b_01110000,
2627 0b_10101000,
2628 0b_00000000,
2629 /* 215 */
2630 0b_00000000,
2631 0b_00000000,
2632 0b_11110000,
2633 0b_01001000,
2634 0b_01110000,
2635 0b_01001000,
2636 0b_11110000,
2637 0b_00000000,
2638 /* 216 */
2639 0b_00000000,
2640 0b_00000000,
2641 0b_01000000,
2642 0b_01000000,
2643 0b_01110000,
2644 0b_01001000,
2645 0b_01110000,
2646 0b_00000000,
2647 /* 217 */
2648 0b_00000000,
2649 0b_00000000,
2650 0b_10001000,
2651 0b_10001000,
2652 0b_11001000,
2653 0b_10101000,
2654 0b_11001000,
2655 0b_00000000,
2656 /* 218 */
2657 0b_00000000,
2658 0b_00000000,
2659 0b_11110000,
2660 0b_00001000,
2661 0b_01110000,
2662 0b_00001000,
2663 0b_11110000,
2664 0b_00000000,
2665 /* 219 */
2666 0b_00000000,
2667 0b_00000000,
2668 0b_10101000,
2669 0b_10101000,
2670 0b_10101000,
2671 0b_10101000,
2672 0b_11111000,
2673 0b_00000000,
2674 /* 220 */
2675 0b_00000000,
2676 0b_00000000,
2677 0b_01110000,
2678 0b_10001000,
2679 0b_00111000,
2680 0b_10001000,
2681 0b_01110000,
2682 0b_00000000,
2683 /* 221 */
2684 0b_00000000,
2685 0b_00000000,
2686 0b_10101000,
2687 0b_10101000,
2688 0b_10101000,
2689 0b_11111000,
2690 0b_00001000,
2691 0b_00000000,
2692 /* 222 */
2693 0b_00000000,
2694 0b_00000000,
2695 0b_01001000,
2696 0b_01001000,
2697 0b_01111000,
2698 0b_00001000,
2699 0b_00001000,
2700 0b_00000000,
2701 /* 223 */
2702 0b_00000000,
2703 0b_00000000,
2704 0b_11000000,
2705 0b_01000000,
2706 0b_01110000,
2707 0b_01001000,
2708 0b_01110000,
2709 0b_00000000,
2710 /* 224 */
2711 0b_10010000,
2712 0b_10101000,
2713 0b_10101000,
2714 0b_11101000,
2715 0b_10101000,
2716 0b_10101000,
2717 0b_10010000,
2718 0b_00000000,
2719 /* 225 */
2720 0b_00100000,
2721 0b_01010000,
2722 0b_10001000,
2723 0b_10001000,
2724 0b_11111000,
2725 0b_10001000,
2726 0b_10001000,
2727 0b_00000000,
2728 /* 226 */
2729 0b_11111000,
2730 0b_10001000,
2731 0b_10000000,
2732 0b_11110000,
2733 0b_10001000,
2734 0b_10001000,
2735 0b_11110000,
2736 0b_00000000,
2737 /* 227 */
2738 0b_10010000,
2739 0b_10010000,
2740 0b_10010000,
2741 0b_10010000,
2742 0b_10010000,
2743 0b_11111000,
2744 0b_00001000,
2745 0b_00000000,
2746 /* 228 */
2747 0b_00111000,
2748 0b_00101000,
2749 0b_00101000,
2750 0b_01001000,
2751 0b_01001000,
2752 0b_11111000,
2753 0b_10001000,
2754 0b_00000000,
2755 /* 229 */
2756 0b_11111000,
2757 0b_10000000,
2758 0b_10000000,
2759 0b_11110000,
2760 0b_10000000,
2761 0b_10000000,
2762 0b_11111000,
2763 0b_00000000,
2764 /* 230 */
2765 0b_00100000,
2766 0b_01110000,
2767 0b_10101000,
2768 0b_10101000,
2769 0b_10101000,
2770 0b_01110000,
2771 0b_00100000,
2772 0b_00000000,
2773 /* 231 */
2774 0b_11111000,
2775 0b_10001000,
2776 0b_10001000,
2777 0b_10000000,
2778 0b_10000000,
2779 0b_10000000,
2780 0b_10000000,
2781 0b_00000000,
2782 /* 232 */
2783 0b_10001000,
2784 0b_10001000,
2785 0b_01010000,
2786 0b_00100000,
2787 0b_01010000,
2788 0b_10001000,
2789 0b_10001000,
2790 0b_00000000,
2791 /* 233 */
2792 0b_10001000,
2793 0b_10001000,
2794 0b_10011000,
2795 0b_10101000,
2796 0b_11001000,
2797 0b_10001000,
2798 0b_10001000,
2799 0b_00000000,
2800 /* 234 */
2801 0b_01010000,
2802 0b_00100000,
2803 0b_10001000,
2804 0b_10011000,
2805 0b_10101000,
2806 0b_11001000,
2807 0b_10001000,
2808 0b_00000000,
2809 /* 235 */
2810 0b_10001000,
2811 0b_10010000,
2812 0b_10100000,
2813 0b_11000000,
2814 0b_10100000,
2815 0b_10010000,
2816 0b_10001000,
2817 0b_00000000,
2818 /* 236 */
2819 0b_00011000,
2820 0b_00101000,
2821 0b_01001000,
2822 0b_01001000,
2823 0b_01001000,
2824 0b_01001000,
2825 0b_10001000,
2826 0b_00000000,
2827 /* 237 */
2828 0b_10001000,
2829 0b_11011000,
2830 0b_10101000,
2831 0b_10101000,
2832 0b_10001000,
2833 0b_10001000,
2834 0b_10001000,
2835 0b_00000000,
2836 /* 238 */
2837 0b_10001000,
2838 0b_10001000,
2839 0b_10001000,
2840 0b_11111000,
2841 0b_10001000,
2842 0b_10001000,
2843 0b_10001000,
2844 0b_00000000,
2845 /* 239 */
2846 0b_01110000,
2847 0b_10001000,
2848 0b_10001000,
2849 0b_10001000,
2850 0b_10001000,
2851 0b_10001000,
2852 0b_01110000,
2853 0b_00000000,
2854 /* 240 */
2855 0b_11111000,
2856 0b_10001000,
2857 0b_10001000,
2858 0b_10001000,
2859 0b_10001000,
2860 0b_10001000,
2861 0b_10001000,
2862 0b_00000000,
2863 /* 241 */
2864 0b_01111000,
2865 0b_10001000,
2866 0b_10001000,
2867 0b_01111000,
2868 0b_00101000,
2869 0b_01001000,
2870 0b_10001000,
2871 0b_00000000,
2872 /* 242 */
2873 0b_11110000,
2874 0b_10001000,
2875 0b_10001000,
2876 0b_11110000,
2877 0b_10000000,
2878 0b_10000000,
2879 0b_10000000,
2880 0b_00000000,
2881 /* 243 */
2882 0b_01110000,
2883 0b_10001000,
2884 0b_10000000,
2885 0b_10000000,
2886 0b_10000000,
2887 0b_10001000,
2888 0b_01110000,
2889 0b_00000000,
2890 /* 244 */
2891 0b_11111000,
2892 0b_00100000,
2893 0b_00100000,
2894 0b_00100000,
2895 0b_00100000,
2896 0b_00100000,
2897 0b_00100000,
2898 0b_00000000,
2899 /* 245 */
2900 0b_10001000,
2901 0b_10001000,
2902 0b_10001000,
2903 0b_01010000,
2904 0b_00100000,
2905 0b_01000000,
2906 0b_10000000,
2907 0b_00000000,
2908 /* 246 */
2909 0b_10101000,
2910 0b_10101000,
2911 0b_01110000,
2912 0b_00100000,
2913 0b_01110000,
2914 0b_10101000,
2915 0b_10101000,
2916 0b_00000000,
2917 /* 247 */
2918 0b_11110000,
2919 0b_01001000,
2920 0b_01001000,
2921 0b_01110000,
2922 0b_01001000,
2923 0b_01001000,
2924 0b_11110000,
2925 0b_00000000,
2926 /* 248 */
2927 0b_10000000,
2928 0b_10000000,
2929 0b_10000000,
2930 0b_11110000,
2931 0b_10001000,
2932 0b_10001000,
2933 0b_11110000,
2934 0b_00000000,
2935 /* 249 */
2936 0b_10001000,
2937 0b_10001000,
2938 0b_10001000,
2939 0b_11001000,
2940 0b_10101000,
2941 0b_10101000,
2942 0b_11001000,
2943 0b_00000000,
2944 /* 250 */
2945 0b_11110000,
2946 0b_00001000,
2947 0b_00001000,
2948 0b_00110000,
2949 0b_00001000,
2950 0b_00001000,
2951 0b_11110000,
2952 0b_00000000,
2953 /* 251 */
2954 0b_10101000,
2955 0b_10101000,
2956 0b_10101000,
2957 0b_10101000,
2958 0b_10101000,
2959 0b_10101000,
2960 0b_11111000,
2961 0b_00000000,
2962 /* 252 */
2963 0b_01110000,
2964 0b_10001000,
2965 0b_00001000,
2966 0b_01111000,
2967 0b_00001000,
2968 0b_10001000,
2969 0b_01110000,
2970 0b_00000000,
2971 /* 253 */
2972 0b_10101000,
2973 0b_10101000,
2974 0b_10101000,
2975 0b_10101000,
2976 0b_10101000,
2977 0b_11111000,
2978 0b_00001000,
2979 0b_00000000,
2980 /* 254 */
2981 0b_10001000,
2982 0b_10001000,
2983 0b_10001000,
2984 0b_10001000,
2985 0b_01111000,
2986 0b_00001000,
2987 0b_00001000,
2988 0b_00000000,
2989 /* 255 */
2990 0b_11000000,
2991 0b_01000000,
2992 0b_01000000,
2993 0b_01110000,
2994 0b_01001000,
2995 0b_01001000,
2996 0b_01110000,
2997 0b_00000000,
3001 // bits 0..3: width
3002 // bits 4..7: lshift
3003 public immutable ubyte[256] vlFontPropWidth = () {
3004 ubyte[256] res;
3005 foreach (immutable cnum; 0..256) {
3006 import core.bitop : bsf, bsr;
3007 immutable doshift =
3008 (cnum >= 32 && cnum <= 127) ||
3009 (cnum >= 143 && cnum <= 144) ||
3010 (cnum >= 166 && cnum <= 167) ||
3011 (cnum >= 192 && cnum <= 255);
3012 int shift = 0;
3013 if (doshift) {
3014 shift = 8;
3015 foreach (immutable dy; 0..8) {
3016 immutable b = vlFont6[cnum*8+dy];
3017 if (b) {
3018 immutable mn = 7-bsr(b);
3019 if (mn < shift) shift = mn;
3023 ubyte wdt = 0;
3024 foreach (immutable dy; 0..8) {
3025 immutable b = (vlFont6[cnum*8+dy]<<shift);
3026 immutable cwdt = (b ? 8-bsf(b) : 0);
3027 if (cwdt > wdt) wdt = cast(ubyte)cwdt;
3029 switch (cnum) {
3030 case 0: wdt = 8; break; // 8px space
3031 case 32: wdt = 5; break; // 5px space
3032 case 17: .. case 27: wdt = 8; break; // single frames
3033 case 48: .. case 57: wdt = 5; break; // digits are monospaced
3034 case 127: .. case 142: wdt = 8; break; // filled frames
3035 case 145: .. case 151: wdt = 8; break; // filled frames
3036 case 155: .. case 159: wdt = 8; break; // filled frames
3037 default:
3039 res[cnum] = (wdt&0x0f)|((shift<<4)&0xf0);
3041 return res;
3042 }();