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