From fdc58fb6b2fddec9e179baaba53e059ae1e54a54 Mon Sep 17 00:00:00 2001 From: hgn Date: Thu, 20 Jan 2022 01:23:11 +0000 Subject: [PATCH] new font --- build.sh | 3 + fontcomp.c | 4 +- fonts/numbers/n0.h | 9 -- fonts/numbers/n1.h | 5 - fonts/numbers/n2.h | 11 -- fonts/numbers/n3.h | 12 --- fonts/numbers/n4.h | 10 -- fonts/numbers/n5.h | 11 -- fonts/numbers/n6.h | 14 --- fonts/numbers/n7.h | 5 - fonts/numbers/n8.h | 17 --- fonts/numbers/n9.h | 14 --- fonts/vg_font.png | Bin 0 -> 3017 bytes vg/vg_console.h | 27 +++-- vg/vg_pxfont.h | 257 +++++++++++++++++++++++++++++++++++++++++++++ vg/vg_ui.h | 32 +++--- 16 files changed, 300 insertions(+), 131 deletions(-) delete mode 100644 fonts/numbers/n0.h delete mode 100644 fonts/numbers/n1.h delete mode 100644 fonts/numbers/n2.h delete mode 100644 fonts/numbers/n3.h delete mode 100644 fonts/numbers/n4.h delete mode 100644 fonts/numbers/n5.h delete mode 100644 fonts/numbers/n6.h delete mode 100644 fonts/numbers/n7.h delete mode 100644 fonts/numbers/n8.h delete mode 100644 fonts/numbers/n9.h create mode 100644 fonts/vg_font.png create mode 100644 vg/vg_pxfont.h diff --git a/build.sh b/build.sh index 63f64de..2a31674 100755 --- a/build.sh +++ b/build.sh @@ -88,6 +88,9 @@ done ../tools/texsheet ../_temp_textures/autocombine.qoi ../sprites_autocombine.h sprites_auto_combine $auto_combine cd .. +# Compile font file +./tools/fontcomp fonts/vg_font.png vg/vg_pxfont.h + # Main build if [ "$do_build" = true ]; then gcc -Wall -Wstrict-aliasing=3 $lib $flags $src gl/glad.c -o $target $libs $steam_part -Wl,-rpath=./ $defines diff --git a/fontcomp.c b/fontcomp.c index 73046b8..c2d26ac 100644 --- a/fontcomp.c +++ b/fontcomp.c @@ -39,7 +39,7 @@ int main( int argc, char *argv[] ) u32 buff = 0; for( int b = 31; b >= 0; b-- ) { - buff |= data[pixel*4+3]>128?0x1<128?0x1<= pixel_max ) @@ -56,6 +56,8 @@ int main( int argc, char *argv[] ) free(data); fclose(output); + + vg_success( "Font compiled successfully\n" ); } else { diff --git a/fonts/numbers/n0.h b/fonts/numbers/n0.h deleted file mode 100644 index 111d132..0000000 --- a/fonts/numbers/n0.h +++ /dev/null @@ -1,9 +0,0 @@ -/*triangle buffer generated from source file: 'models/n0.obj'*/ -0.500000f,-0.000000f,0.375000f,0.875000f,0.375000f,0.125000f, -0.500000f,1.000000f,0.125000f,0.875000f,0.375000f,0.875000f, -0.375000f,0.125000f,0.000000f,-0.000000f,0.500000f,-0.000000f, -0.000000f,-0.000000f,0.125000f,0.875000f,0.000000f,1.000000f, -0.500000f,-0.000000f,0.500000f,1.000000f,0.375000f,0.875000f, -0.500000f,1.000000f,0.000000f,1.000000f,0.125000f,0.875000f, -0.375000f,0.125000f,0.125000f,0.125000f,0.000000f,-0.000000f, -0.000000f,-0.000000f,0.125000f,0.125000f,0.125000f,0.875000f, diff --git a/fonts/numbers/n1.h b/fonts/numbers/n1.h deleted file mode 100644 index 6d395ae..0000000 --- a/fonts/numbers/n1.h +++ /dev/null @@ -1,5 +0,0 @@ -/*triangle buffer generated from source file: 'models/n1.obj'*/ -0.437500f,-0.000000f,0.312500f,0.875000f,0.312500f,-0.000000f, -0.312500f,0.875000f,0.250000f,1.000000f,0.250000f,0.875000f, -0.437500f,-0.000000f,0.437500f,1.000000f,0.312500f,0.875000f, -0.312500f,0.875000f,0.437500f,1.000000f,0.250000f,1.000000f, diff --git a/fonts/numbers/n2.h b/fonts/numbers/n2.h deleted file mode 100644 index a71391a..0000000 --- a/fonts/numbers/n2.h +++ /dev/null @@ -1,11 +0,0 @@ -/*triangle buffer generated from source file: 'models/n2.obj'*/ -0.500000f,0.437500f,0.375000f,0.875000f,0.375000f,0.562500f, -0.125000f,0.437500f,0.375000f,0.562500f,0.000000f,0.562500f, -0.125000f,0.125000f,0.000000f,0.562500f,0.000000f,-0.000000f, -0.375000f,0.875000f,0.000000f,1.000000f,0.000000f,0.875000f, -0.125000f,0.125000f,0.500000f,-0.000000f,0.500000f,0.125000f, -0.500000f,0.437500f,0.500000f,1.000000f,0.375000f,0.875000f, -0.125000f,0.437500f,0.500000f,0.437500f,0.375000f,0.562500f, -0.125000f,0.125000f,0.125000f,0.437500f,0.000000f,0.562500f, -0.375000f,0.875000f,0.500000f,1.000000f,0.000000f,1.000000f, -0.125000f,0.125000f,0.000000f,-0.000000f,0.500000f,-0.000000f, diff --git a/fonts/numbers/n3.h b/fonts/numbers/n3.h deleted file mode 100644 index fb91e11..0000000 --- a/fonts/numbers/n3.h +++ /dev/null @@ -1,12 +0,0 @@ -/*triangle buffer generated from source file: 'models/n3.obj'*/ -0.500000f,0.562500f,0.375000f,0.875000f,0.375000f,0.562500f, -0.000000f,0.437500f,0.375000f,0.562500f,0.000000f,0.562500f, -0.500000f,0.562500f,0.375000f,0.125000f,0.500000f,-0.000000f, -0.375000f,0.875000f,0.000000f,1.000000f,0.000000f,0.875000f, -0.375000f,0.562500f,0.375000f,0.437500f,0.500000f,0.562500f, -0.375000f,0.125000f,0.000000f,-0.000000f,0.500000f,-0.000000f, -0.500000f,0.562500f,0.500000f,1.000000f,0.375000f,0.875000f, -0.000000f,0.437500f,0.375000f,0.437500f,0.375000f,0.562500f, -0.500000f,0.562500f,0.375000f,0.437500f,0.375000f,0.125000f, -0.375000f,0.875000f,0.500000f,1.000000f,0.000000f,1.000000f, -0.375000f,0.125000f,0.000000f,0.125000f,0.000000f,-0.000000f, diff --git a/fonts/numbers/n4.h b/fonts/numbers/n4.h deleted file mode 100644 index 065737c..0000000 --- a/fonts/numbers/n4.h +++ /dev/null @@ -1,10 +0,0 @@ -/*triangle buffer generated from source file: 'models/n4.obj'*/ -0.125000f,0.562500f,0.000000f,1.000000f,0.000000f,0.437500f, -0.125000f,0.562500f,0.375000f,0.437500f,0.375000f,0.562500f, -0.375000f,0.562500f,0.375000f,0.437500f,0.500000f,0.562500f, -0.500000f,0.562500f,0.375000f,1.000000f,0.375000f,0.562500f, -0.375000f,0.437500f,0.500000f,-0.000000f,0.500000f,0.562500f, -0.125000f,0.562500f,0.125000f,1.000000f,0.000000f,1.000000f, -0.125000f,0.562500f,0.000000f,0.437500f,0.375000f,0.437500f, -0.500000f,0.562500f,0.500000f,1.000000f,0.375000f,1.000000f, -0.375000f,0.437500f,0.375000f,-0.000000f,0.500000f,-0.000000f, diff --git a/fonts/numbers/n5.h b/fonts/numbers/n5.h deleted file mode 100644 index 176aed8..0000000 --- a/fonts/numbers/n5.h +++ /dev/null @@ -1,11 +0,0 @@ -/*triangle buffer generated from source file: 'models/n5.obj'*/ -0.125000f,0.875000f,0.000000f,0.437500f,0.125000f,0.562500f, -0.125000f,0.562500f,0.375000f,0.437500f,0.500000f,0.562500f, -0.500000f,0.562500f,0.375000f,0.125000f,0.500000f,-0.000000f, -0.125000f,0.875000f,0.500000f,1.000000f,0.000000f,1.000000f, -0.375000f,0.125000f,0.000000f,-0.000000f,0.500000f,-0.000000f, -0.125000f,0.875000f,0.000000f,1.000000f,0.000000f,0.437500f, -0.125000f,0.562500f,0.000000f,0.437500f,0.375000f,0.437500f, -0.500000f,0.562500f,0.375000f,0.437500f,0.375000f,0.125000f, -0.125000f,0.875000f,0.500000f,0.875000f,0.500000f,1.000000f, -0.375000f,0.125000f,0.000000f,0.125000f,0.000000f,-0.000000f, diff --git a/fonts/numbers/n6.h b/fonts/numbers/n6.h deleted file mode 100644 index 675ea5b..0000000 --- a/fonts/numbers/n6.h +++ /dev/null @@ -1,14 +0,0 @@ -/*triangle buffer generated from source file: 'models/n6.obj'*/ -0.500000f,0.562500f,0.375000f,0.125000f,0.500000f,-0.000000f, -0.125000f,0.125000f,0.500000f,-0.000000f,0.375000f,0.125000f, -0.125000f,0.437500f,0.000000f,-0.000000f,0.125000f,0.125000f, -0.125000f,0.437500f,0.125000f,0.562500f,0.000000f,0.562500f, -0.125000f,0.562500f,0.375000f,0.437500f,0.500000f,0.562500f, -0.125000f,0.875000f,0.000000f,0.562500f,0.125000f,0.562500f, -0.125000f,0.875000f,0.500000f,1.000000f,0.000000f,1.000000f, -0.500000f,0.562500f,0.375000f,0.437500f,0.375000f,0.125000f, -0.125000f,0.125000f,0.000000f,-0.000000f,0.500000f,-0.000000f, -0.125000f,0.437500f,0.000000f,0.562500f,0.000000f,-0.000000f, -0.125000f,0.562500f,0.125000f,0.437500f,0.375000f,0.437500f, -0.125000f,0.875000f,0.000000f,1.000000f,0.000000f,0.562500f, -0.125000f,0.875000f,0.500000f,0.875000f,0.500000f,1.000000f, diff --git a/fonts/numbers/n7.h b/fonts/numbers/n7.h deleted file mode 100644 index f3016f3..0000000 --- a/fonts/numbers/n7.h +++ /dev/null @@ -1,5 +0,0 @@ -/*triangle buffer generated from source file: 'models/n7.obj'*/ -0.500000f,-0.000000f,0.375000f,0.875000f,0.375000f,-0.000000f, -0.375000f,0.875000f,0.000000f,1.000000f,0.000000f,0.875000f, -0.500000f,-0.000000f,0.500000f,1.000000f,0.375000f,0.875000f, -0.375000f,0.875000f,0.500000f,1.000000f,0.000000f,1.000000f, diff --git a/fonts/numbers/n8.h b/fonts/numbers/n8.h deleted file mode 100644 index e7f5957..0000000 --- a/fonts/numbers/n8.h +++ /dev/null @@ -1,17 +0,0 @@ -/*triangle buffer generated from source file: 'models/n8.obj'*/ -0.500000f,0.562500f,0.375000f,0.125000f,0.500000f,-0.000000f, -0.125000f,0.125000f,0.500000f,-0.000000f,0.375000f,0.125000f, -0.125000f,0.437500f,0.000000f,-0.000000f,0.125000f,0.125000f, -0.125000f,0.437500f,0.125000f,0.562500f,0.000000f,0.562500f, -0.125000f,0.562500f,0.375000f,0.437500f,0.375000f,0.562500f, -0.125000f,0.875000f,0.000000f,0.562500f,0.125000f,0.562500f, -0.375000f,0.875000f,0.000000f,1.000000f,0.125000f,0.875000f, -0.500000f,0.562500f,0.375000f,0.562500f,0.375000f,0.437500f, -0.375000f,0.875000f,0.500000f,0.562500f,0.500000f,1.000000f, -0.500000f,0.562500f,0.375000f,0.437500f,0.375000f,0.125000f, -0.125000f,0.125000f,0.000000f,-0.000000f,0.500000f,-0.000000f, -0.125000f,0.437500f,0.000000f,0.562500f,0.000000f,-0.000000f, -0.125000f,0.562500f,0.125000f,0.437500f,0.375000f,0.437500f, -0.125000f,0.875000f,0.000000f,1.000000f,0.000000f,0.562500f, -0.375000f,0.875000f,0.500000f,1.000000f,0.000000f,1.000000f, -0.375000f,0.875000f,0.375000f,0.562500f,0.500000f,0.562500f, diff --git a/fonts/numbers/n9.h b/fonts/numbers/n9.h deleted file mode 100644 index ccc3e6c..0000000 --- a/fonts/numbers/n9.h +++ /dev/null @@ -1,14 +0,0 @@ -/*triangle buffer generated from source file: 'models/n9.obj'*/ -0.000000f,1.000000f,0.125000f,0.562500f,0.125000f,0.875000f, -0.375000f,0.875000f,0.000000f,1.000000f,0.125000f,0.875000f, -0.375000f,0.875000f,0.500000f,0.437500f,0.500000f,1.000000f, -0.375000f,0.562500f,0.375000f,0.437500f,0.500000f,0.437500f, -0.375000f,0.437500f,0.125000f,0.562500f,0.000000f,0.437500f, -0.375000f,0.125000f,0.500000f,0.437500f,0.375000f,0.437500f, -0.375000f,0.125000f,0.000000f,-0.000000f,0.500000f,-0.000000f, -0.000000f,1.000000f,0.000000f,0.437500f,0.125000f,0.562500f, -0.375000f,0.875000f,0.500000f,1.000000f,0.000000f,1.000000f, -0.375000f,0.875000f,0.375000f,0.562500f,0.500000f,0.437500f, -0.375000f,0.437500f,0.375000f,0.562500f,0.125000f,0.562500f, -0.375000f,0.125000f,0.500000f,-0.000000f,0.500000f,0.437500f, -0.375000f,0.125000f,0.000000f,0.125000f,0.000000f,-0.000000f, diff --git a/fonts/vg_font.png b/fonts/vg_font.png new file mode 100644 index 0000000000000000000000000000000000000000..282b38aa49a307ea153ec52c28f5d6033ef7b63a GIT binary patch literal 3017 zcmcImdoEPhz;^3eamk=8k8664$`|~sMVaHy%?Y?sA z%!$Wm)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IXez;8N|0ePxH z?eupI5h%i5KI+vv4WCpnY~S*kB~0OIVAGY*U!Nv^JF`v<2KgdxyTi%^GYqO7Ib(Ef zuu;>i*zVJ+iVbQLJ=pursu5cRr{(V=Hm8SaE*wi8%H4ITXPsx(e#bfIRT%w^Gqij3 zCgz-Q#(J|s@7)?+nRQuFshsqgXI???C8OY34%u1A_Inh#xJ9BJ<~1v>P`j`DTZ$pj zSca$ajvFUlf$oCXkD8^=nGNMKB2{Mo{7=nlepSYYV2V$h60F#LfsQ)&i6|`4ped=JGkv2{uV;>SMlX6ICWFfx{(l zwWDJh;*`^+bfJLKv^zYSMM-_75O$?~ffWk}yo(#YN0)8h$;w^D8dPUqx!)kv0GFiX zL2zIBD-&!5H6P?!8b@aqA^1uUbsPv^!f@1b16~l4f^3`gKEhD$i-L2EDm-_muOPB{ zxX5zB=6A5xBq*X_#rb}dfUjV4^j6%5HKCPD&z;E|2X&mr1ioNvv|SF;zO(F_!6*(1 zY=&M)CbBNH!9+f>%1em{$!TH$h^GT+9HNQXDIu)t}f$i*SwRLW6AT& zOuoh(IPkhYKi5Bt3N70@S)c<1`rC+Qi740gut(fp7Vtg*=%bI^^5lEhS`;*seS)pS zd|0zT1E{Q*&4R@p#pY$GLT-HtlZvB7^thOYb$~)C5hGE^8ZGIZNf?iEGH`AV;ual>LO|{W7`0(F+Yk2XBKVEPgT$C0jK( z&dSf^_Z=H)!f<;_X!GuGErYE~2rDQSCJMaN0tI`*t(j>isMgPbyT z2tA*~_b`sKuFZ4R!AX0-Kvhp-==59&\n" ); + return 0; +} + static void vg_console_init(void) { vg_log_callback = vg_console_println; @@ -191,6 +201,11 @@ static void vg_console_init(void) .function = vg_console_list }); + vg_function_push( (struct vg_cmd){ + .name = "chartest", + .function = vg_console_chartest + }); + // Read and exec persistent commands FILE *fp = fopen( "cfg/auto.conf", "r" ); if( fp ) diff --git a/vg/vg_pxfont.h b/vg/vg_pxfont.h new file mode 100644 index 0000000..9333877 --- /dev/null +++ b/vg/vg_pxfont.h @@ -0,0 +1,257 @@ +/* Font buffer generated from source file: 'fonts/vg_font.png' */ +0xffff0000,0,0,0,0,0,0,0, +0xffff0000,0,0,0,0,0,0,0, +0xffff0000,0,0,0,0,0,0,0, +0xffff0000,0,0,0,0,0,0,0, +0xffff0c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30, +0xffff0810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810, +0xffff0000,0,0,0,0,0,0,0, +0xffff0040,0x8000c0,0x1000140,0x18001c0,0x2000240,0x28002c0,0x3000340,0x38003c0, +0xffff0000,0,0,0,0,0,0,0, +0xffff0000,0,0,0,0,0,0,0, +0xffff0000,0,0,0,0,0,0,0, +0xffff0000,0,0,0,0,0,0,0, +0xffff0810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810, +0xffff0c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30, +0xffff0000,0,0,0,0,0,0,0, +0xffff0000,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30, +0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810, +0x400040,0x400040,0x400040,0x400040,0x400040,0x400040,0x400040,0x400040, +0x40,0x8000c0,0x1000140,0x18001c0,0x2000240,0x28002c0,0x3000340,0x38003c0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810,0x8100810, +0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30,0xc300c30, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0x6600000,0x1800000,0x180,0,0,0,0, +0,0x6600000,0x1800000,0x180,0x1c00380,0,0,0, +0xc300180,0x6600660,0x3c00660,0x3c00180,0x38001c0,0x800000,0,0x60, +0x8100180,0x2200660,0x7e00660,0x7e00080,0x30000c0,0x2a00180,0,0x60, +0x800180,0xff0,0x60000e0,0x6600000,0x6000060,0x1c00180,0,0xe0, +0x180,0xff0,0x60000c0,0x6600000,0x6000060,0x1c00180,0,0xc0, +0x180,0x660,0x7c00180,0x3200000,0x6000060,0x2a00ff0,0x7e0,0x180, +0x180,0x660,0x3e00180,0x3800000,0x6000060,0x800ff0,0x7e0,0x180, +0,0xff0,0x600300,0x6c00000,0x6000060,0x180,0,0x300, +0,0xff0,0x600700,0x6600000,0x6000060,0x180,0,0x700, +0x8100180,0x660,0x7e00660,0x7f00000,0x30000c0,0x180,0x1800000,0x1800600, +0xc300180,0x660,0x3c00660,0x3b00000,0x38001c0,0,0x1800000,0x1800600, +0,0,0x1800000,0,0x1c00380,0,0x1000000,0, +0,0,0x1800000,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0x3c00180,0x3c003c0,0xe007c0,0x3c007c0,0x3c003c0,0,0x600000,0x60003e0, +0x7e00380,0x7e007e0,0x1e007e0,0x7e007e0,0x7e007e0,0,0xe00000,0x70007f0, +0x6600380,0x4600060,0x3e00600,0x6000060,0x6600660,0x1800180,0x1c007e0,0x3800630, +0xcf00180,0x600060,0x7600600,0x6000060,0x6600660,0x1800180,0x38007e0,0x1c00030, +0xdf00180,0xe001e0,0xe6007c0,0x7c000c0,0x7e007e0,0,0x7000000,0xe000f0, +0xfb00180,0x1c001e0,0xff007e0,0x7e000c0,0x7e007e0,0,0x7000000,0xe001e0, +0xf300180,0x3800060,0xff00060,0x6600180,0x6600060,0x1800180,0x38007e0,0x1c00180, +0x6600180,0x7000060,0x600060,0x6600180,0x6600060,0x1800180,0x1c007e0,0x3800000, +0x7e003c0,0x7e007e0,0x6007e0,0x7e00300,0x7e007e0,0x80,0xe00000,0x7000180, +0x3c003c0,0x7e003c0,0x6003c0,0x3c00300,0x3c003c0,0,0x600000,0x6000180, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0x3c0,0x7c001c0,0x78007e0,0x3e003e0,0x66007e0,0x7e00660,0x6000660,0x3c003c0, +0x3c007e0,0x7e003e0,0x7c007e0,0x3e007f0,0x66007e0,0x3e00660,0x6000ff0,0x7e007e0, +0x7e00660,0x6600700,0x6e00600,0x3000e00,0x6600180,0x6006c0,0x6000ff0,0x6600e70, +0x300660,0x6600600,0x6600600,0x3000c00,0x6600180,0x6007c0,0x6000db0,0x6600c30, +0x3b00660,0x7e00600,0x66007c0,0x3e00c00,0x7e00180,0x600780,0x6000db0,0x6600c30, +0x7f007e0,0x7c00600,0x66007c0,0x3e00c70,0x7e00180,0x600780,0x6000db0,0x6600c30, +0x67007e0,0x6600600,0x6600600,0x3000c30,0x6600180,0x6007c0,0x6000c30,0x6600c30, +0x7f00660,0x6600700,0x6e00600,0x3000e30,0x6600180,0xe006c0,0x6000c30,0x6600e70, +0x3e00660,0x7e003e0,0x7c007e0,0x30007e0,0x66007e0,0x7c00660,0x7e00c30,0x66007e0, +0x660,0x7c001c0,0x78007e0,0x30003c0,0x66007e0,0x7800660,0x3e00c30,0x66003c0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0x3c0,0x3c0,0x1800000, +0x7c003c0,0x3c003c0,0x7e00660,0x6600c30,0xc300660,0x7e003c0,0x60003c0,0x3c00000, +0x7e007e0,0x7e007e0,0x7e00660,0x6600c30,0xe700660,0x3e00380,0x60001c0,0x3c00000, +0x6600660,0x6600600,0x1800660,0x6600c30,0x6600660,0xc00300,0x70000c0,0x6600000, +0x6600660,0x6600600,0x1800660,0x6600c30,0x7e00660,0xc00300,0x30000c0,0x4200000, +0x6600660,0x7e007c0,0x1800660,0x6600db0,0x3c007e0,0x1800300,0x18000c0,0, +0x7e006e0,0x7c003e0,0x1800660,0x6600db0,0x3c003e0,0x1800300,0x18000c0,0, +0x7c006e0,0x6c00060,0x1800660,0x6600db0,0x7e00060,0x3000300,0xc000c0,0, +0x6000670,0x6e00060,0x1800660,0x7e00ff0,0x6600060,0x3000300,0xe000c0,0, +0x60007b0,0x66007e0,0x18007e0,0x3c00ff0,0xe7007e0,0x7c00380,0x6001c0,0, +0x60003d0,0x66003c0,0x18003c0,0x1800660,0xc3003c0,0x7e003c0,0x6003c0,0xff0, +0,0,0,0,0,0x3c0,0x3c0,0xff0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0x3000000,0,0,0,0,0,0,0, +0x3000000,0,0,0,0,0,0,0, +0x1800000,0x6000000,0x600000,0,0x6000180,0x1800600,0x6000000,0, +0x800000,0x6000000,0x600000,0,0x6000180,0x1800600,0x6000000,0, +0x1c0,0x60003c0,0x6003c0,0x1e003c0,0x6000000,0x600,0x60007e0,0x3c007e0, +0x3e0,0x7c007e0,0x3e007e0,0x3e007e0,0x6000380,0x38006e0,0x6000ff0,0x7e00ff0, +0x60,0x7e00600,0x7e00660,0x3000660,0x7c00180,0x18007c0,0x6000db0,0x7e00e70, +0x3e0,0x6600600,0x66006e0,0x3000660,0x7e00180,0x1800780,0x6000db0,0x6600c30, +0x660,0x6600600,0x66007c0,0x3000660,0x6600180,0x18007c0,0x6000c30,0x6600c30, +0x660,0x6600600,0x6600700,0x3e007e0,0x6600180,0x18006c0,0x6000c30,0x6600e70, +0x7e0,0x7e007e0,0x7e003e0,0x3c003e0,0x6600180,0x1800660,0x7e00c30,0x6600ff0, +0x3e0,0x7c003c0,0x3e001c0,0x3000060,0x6600180,0x1800660,0x3e00c30,0x66007e0, +0,0,0,0x70007e0,0,0x3800000,0,0, +0,0,0,0x60003c0,0,0x3000000,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0xc0,0x300,0, +0,0,0x3000000,0,0,0x1c0,0x1800380,0, +0,0,0x3000000,0,0,0x180,0x1800180,0, +0x3c003c0,0x1c001c0,0x3000660,0xc300c30,0xc300660,0x7e00180,0x1800180,0, +0x7e007e0,0x3c003c0,0x3000660,0xc300c30,0xe700660,0x7e00380,0x18001c0,0x7300000, +0x6600660,0x3000300,0x3c00660,0x6600c30,0x7e00660,0xe00700,0x18000e0,0xfb00000, +0x6600660,0x3000380,0x3c00660,0x6600c30,0x3c00660,0x1c00700,0x18000e0,0xdf00000, +0x6600660,0x30001c0,0x3000660,0x6600db0,0x3c00660,0x3800380,0x18001c0,0xce00000, +0x6600660,0x30000c0,0x3000660,0x3c00db0,0x7e007e0,0x7000180,0x1800180,0, +0x7e007e0,0x30003c0,0x3c007e0,0x3c00ff0,0xe7003e0,0x7e00180,0x1800180,0, +0x7c003e0,0x3000380,0x1c003c0,0x1800660,0xc300060,0x7e001c0,0x1800380,0, +0x6000060,0,0,0,0x7e0,0xc0,0x300,0, +0x6000060,0,0,0,0x3c0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0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, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0, diff --git a/vg/vg_ui.h b/vg/vg_ui.h index f6693cb..d4fb20b 100644 --- a/vg/vg_ui.h +++ b/vg/vg_ui.h @@ -17,7 +17,7 @@ SHADER_DEFINE( shader_ui, "void main()" "{" "gl_Position = vec4( uPv * vec3( a_co, 1.0 ), 1.0 );" - "aTexCoords = a_uv * 0.01388888888;" + "aTexCoords = a_uv * 0.0078125;" "aColour = a_colour;" "aWsp = a_co;" @@ -149,7 +149,7 @@ struct ui_ctx // Opengl int ui_glyph_override = 0; -ui_px ui_glyph_spacing_x = 6; +ui_px ui_glyph_spacing_x = 9; GLuint ui_glyph_texture = 0; ui_colourset ui_default_colours = { @@ -240,10 +240,10 @@ static void ui_default_init(void) if( !ui_glyph_override ) { u32 compressed[] = { - #include "fonts/weiholmir.h" + #include "vg/vg_pxfont.h" }; - u32 pixels = 0, total = 72*72, data = 0; + u32 pixels = 0, total = 256*256, data = 0; u8 *image = malloc( total ); while( pixels < total ) @@ -264,7 +264,7 @@ static void ui_default_init(void) glGenTextures( 1, &ui_glyph_texture ); glBindTexture( GL_TEXTURE_2D, ui_glyph_texture ); - glTexImage2D( GL_TEXTURE_2D, 0, GL_R8, 72, 72, 0, GL_RED, GL_UNSIGNED_BYTE, image ); + glTexImage2D( GL_TEXTURE_2D, 0, GL_R8, 256, 256, 0, GL_RED, GL_UNSIGNED_BYTE, image ); vg_tex2d_clamp(); vg_tex2d_nearest(); @@ -567,7 +567,7 @@ static struct ui_vert *ui_fill_rect_uv( ui_ctx *ctx, ui_rect rect, u32 colour, u static struct ui_vert *ui_fill_rect( ui_ctx *ctx, ui_rect rect, u32 colour ) { - return ui_fill_rect_uv( ctx, rect, colour, (ui_px[4]){ 4,124,4,124 } ); + return ui_fill_rect_uv( ctx, rect, colour, (ui_px[4]){ 4,4, 4,4 } ); } static void ui_text( ui_ctx *ctx, const char *str, ui_px scale ) @@ -576,8 +576,8 @@ static void ui_text( ui_ctx *ctx, const char *str, ui_px scale ) text_cursor[0] = ctx->cursor[0]; text_cursor[1] = ctx->cursor[1]; - text_cursor[2] = 7*scale; - text_cursor[3] = 7*scale; + text_cursor[2] = 8*scale; + text_cursor[3] = 14*scale; u32 current_colour = 0x00ffffff; @@ -587,21 +587,21 @@ static void ui_text( ui_ctx *ctx, const char *str, ui_px scale ) { if( c == '\n' ) { - text_cursor[1] += 10*scale; + text_cursor[1] += 14*scale; text_cursor[0] = ctx->cursor[0]; continue; } else if( c >= 33 && c <= 126 ) { u8 glyph_base[2]; - u8 glyph_index = c - 32; - glyph_base[0] = glyph_index%10; - glyph_base[1] = (glyph_index-glyph_base[0])/10; + u8 glyph_index = c; + glyph_base[0] = glyph_index & 0xf; + glyph_base[1] = (glyph_index-glyph_base[0])>>4; - glyph_base[0] *= 7; - glyph_base[1] *= 7; + glyph_base[0] *= 8; + glyph_base[1] *= 8; - ui_fill_rect_uv( ctx, text_cursor, current_colour, (ui_px[4]){glyph_base[0],glyph_base[1],glyph_base[0]+7,glyph_base[1]+7} ); + ui_fill_rect_uv( ctx, text_cursor, current_colour, (ui_px[4]){glyph_base[0]+2,glyph_base[1]+1,glyph_base[0]+6,glyph_base[1]+8} ); } else if( c == '\x1B' ) { @@ -640,7 +640,7 @@ static void ui_text( ui_ctx *ctx, const char *str, ui_px scale ) } } - text_cursor[0] += 6*scale; + text_cursor[0] += 9*scale; } } -- 2.25.1