From 7fcce0da98bad896df3b89abaa379063843f8eaa Mon Sep 17 00:00:00 2001 From: Paula Date: Sat, 7 Mar 2026 18:40:33 -0300 Subject: [PATCH] Fix font rendering --- assets/fonts/m6x11.fnt | 100 +++++++++ assets/fonts/m6x11.png | Bin 0 -> 1887 bytes build.ts | 48 +++- client/assets.ts | 2 +- client/index.html | 12 - client/main.ts | 7 +- client/renderer.ts | 267 +++++++++++++---------- client/systems/rendering/render_utils.ts | 19 +- 8 files changed, 307 insertions(+), 148 deletions(-) create mode 100644 assets/fonts/m6x11.fnt create mode 100644 assets/fonts/m6x11.png diff --git a/assets/fonts/m6x11.fnt b/assets/fonts/m6x11.fnt new file mode 100644 index 0000000..7babc6b --- /dev/null +++ b/assets/fonts/m6x11.fnt @@ -0,0 +1,100 @@ +info face="m6x11 Medium" size=16 bold=0 italic=0 charset="unic" unicode=1 padding=4,4,4,4 spacing=0,0 +common lineHeight=15.4375 base=11 ascent=11 descent=-3 scaleW=256 scaleH=128 pages=1 packed=0 +page id=0 file="Unknown.png" +chars count=95 +char id=32 x=20 y=95 width=9 height=9 xoffset=0 yoffset=11 xadvance=5 page=1 chnl=15 +char id=33 x=108 y=60 width=10 height=19 xoffset=0 yoffset=0 xadvance=3 page=1 chnl=15 +char id=34 x=217 y=79 width=13 height=11 xoffset=0 yoffset=0 xadvance=6 page=1 chnl=15 +char id=35 x=176 y=0 width=15 height=19 xoffset=0 yoffset=0 xadvance=8 page=1 chnl=15 +char id=36 x=96 y=0 width=14 height=20 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=37 x=199 y=60 width=14 height=16 xoffset=0 yoffset=2 xadvance=7 page=1 chnl=15 +char id=38 x=127 y=0 width=17 height=19 xoffset=0 yoffset=0 xadvance=10 page=1 chnl=15 +char id=39 x=240 y=79 width=10 height=11 xoffset=0 yoffset=0 xadvance=3 page=1 chnl=15 +char id=40 x=62 y=0 width=12 height=21 xoffset=0 yoffset=0 xadvance=5 page=1 chnl=15 +char id=41 x=74 y=0 width=12 height=21 xoffset=0 yoffset=0 xadvance=5 page=1 chnl=15 +char id=42 x=204 y=79 width=13 height=13 xoffset=0 yoffset=0 xadvance=6 page=1 chnl=15 +char id=43 x=120 y=79 width=14 height=14 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=44 x=230 y=79 width=10 height=11 xoffset=0 yoffset=9 xadvance=3 page=1 chnl=15 +char id=45 x=190 y=79 width=14 height=10 xoffset=0 yoffset=5 xadvance=7 page=1 chnl=15 +char id=46 x=10 y=95 width=10 height=10 xoffset=0 yoffset=9 xadvance=3 page=1 chnl=15 +char id=47 x=70 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=48 x=84 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=49 x=98 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=50 x=112 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=51 x=126 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=52 x=140 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=53 x=154 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=54 x=168 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=55 x=182 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=56 x=14 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=57 x=210 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=58 x=110 y=79 width=10 height=16 xoffset=0 yoffset=3 xadvance=3 page=1 chnl=15 +char id=59 x=128 y=60 width=10 height=17 xoffset=0 yoffset=3 xadvance=3 page=1 chnl=15 +char id=60 x=84 y=79 width=13 height=16 xoffset=0 yoffset=3 xadvance=6 page=1 chnl=15 +char id=61 x=134 y=79 width=14 height=14 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=62 x=97 y=79 width=13 height=16 xoffset=0 yoffset=3 xadvance=6 page=1 chnl=15 +char id=63 x=28 y=60 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=64 x=110 y=0 width=17 height=19 xoffset=0 yoffset=0 xadvance=10 page=1 chnl=15 +char id=65 x=42 y=60 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=66 x=56 y=60 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=67 x=70 y=60 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=68 x=84 y=60 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=69 x=140 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=70 x=235 y=0 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=71 x=0 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=72 x=14 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=73 x=28 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=74 x=42 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=75 x=56 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=76 x=70 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=77 x=160 y=0 width=16 height=19 xoffset=0 yoffset=0 xadvance=9 page=1 chnl=15 +char id=78 x=84 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=79 x=98 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=80 x=112 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=81 x=206 y=0 width=15 height=19 xoffset=0 yoffset=0 xadvance=8 page=1 chnl=15 +char id=82 x=126 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=83 x=221 y=0 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=84 x=154 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=85 x=168 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=86 x=182 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=87 x=144 y=0 width=16 height=19 xoffset=0 yoffset=0 xadvance=9 page=1 chnl=15 +char id=88 x=191 y=0 width=15 height=19 xoffset=0 yoffset=0 xadvance=8 page=1 chnl=15 +char id=89 x=196 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=90 x=210 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=91 x=50 y=0 width=12 height=21 xoffset=0 yoffset=0 xadvance=5 page=1 chnl=15 +char id=92 x=224 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=93 x=38 y=0 width=12 height=21 xoffset=0 yoffset=0 xadvance=5 page=1 chnl=15 +char id=94 x=162 y=79 width=14 height=12 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=95 x=176 y=79 width=14 height=10 xoffset=0 yoffset=9 xadvance=7 page=1 chnl=15 +char id=96 x=0 y=95 width=10 height=11 xoffset=0 yoffset=0 xadvance=3 page=1 chnl=15 +char id=97 x=185 y=60 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=98 x=0 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=99 x=56 y=79 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=100 x=238 y=22 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=101 x=70 y=79 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=102 x=14 y=60 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=103 x=0 y=60 width=14 height=19 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=104 x=238 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=105 x=98 y=60 width=10 height=19 xoffset=0 yoffset=0 xadvance=3 page=1 chnl=15 +char id=106 x=0 y=0 width=12 height=22 xoffset=0 yoffset=0 xadvance=5 page=1 chnl=15 +char id=107 x=56 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=108 x=118 y=60 width=10 height=19 xoffset=0 yoffset=0 xadvance=3 page=1 chnl=15 +char id=109 x=154 y=60 width=16 height=16 xoffset=0 yoffset=3 xadvance=9 page=1 chnl=15 +char id=110 x=42 y=79 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=111 x=28 y=79 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=112 x=42 y=41 width=14 height=19 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=113 x=28 y=41 width=14 height=19 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=114 x=14 y=79 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=115 x=0 y=79 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=116 x=196 y=41 width=14 height=19 xoffset=0 yoffset=0 xadvance=7 page=1 chnl=15 +char id=117 x=241 y=60 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=118 x=227 y=60 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=119 x=138 y=60 width=16 height=16 xoffset=0 yoffset=3 xadvance=9 page=1 chnl=15 +char id=120 x=170 y=60 width=15 height=16 xoffset=0 yoffset=3 xadvance=8 page=1 chnl=15 +char id=121 x=224 y=41 width=14 height=19 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=122 x=213 y=60 width=14 height=16 xoffset=0 yoffset=3 xadvance=7 page=1 chnl=15 +char id=123 x=25 y=0 width=13 height=21 xoffset=0 yoffset=0 xadvance=6 page=1 chnl=15 +char id=124 x=86 y=0 width=10 height=21 xoffset=0 yoffset=0 xadvance=3 page=1 chnl=15 +char id=125 x=12 y=0 width=13 height=21 xoffset=0 yoffset=0 xadvance=6 page=1 chnl=15 +char id=126 x=148 y=79 width=14 height=12 xoffset=0 yoffset=4 xadvance=7 page=1 chnl=15 +kernings count=0 diff --git a/assets/fonts/m6x11.png b/assets/fonts/m6x11.png new file mode 100644 index 0000000000000000000000000000000000000000..ff76af403d1e6b12ff50d494b6b725212505322a GIT binary patch literal 1887 zcmV-l2cY zeYT?@48`%CSwP+YBFhe(KPc7K+1LA935Rk9RZAgg_LI@#W&$8T?{Wa+- z4qX=Cb(D^Lw``GRsa+O5d>f*d4W&`8TP4!#2ib;e7RCLy{ZAHd$SI{;x-au2C640A zNcZD(#qB3FoQiFI!Qr z`5%92JXv{0B~8@q|ADYg7ShAcDFw_O#XObb>kF{j$7FJvr~7h)_Z;DM3ec8vvE^fl zA=_;=sip?7EK)M1r(CHCq=d$$+C=nbTN`?$A6l&65G3m0e_wikgRp370G|Nrx3y=r zRqT<+uMf8KRJxJenQE@`SX&q~GX0rFVBXB(?_qU`rGHV(&m~~_mv%=orij)?=3`wT z%4@MgEbTut0+g?LTJK$le=YVpJ;-;yUf<`Em4ClqMPXWa&0DrDZ|*}@HQ;-Fo6_C+ z%2&JYPe-%obKhh97S9nt8$wDO^7SjN-Ra+gQ9AAI`Z^2J&*52Rb&&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A8nz3Z$EA7srP_StMP|zEy|Ww69lrNkJ=)7M2s5!4z?#S6Z zXHiOXLYK5xqB8e}cv2XOhr(*OXL7inTKGCN=>g6@8O$2; { const resp = await fetch(src); this.assets[key] = await resp.text(); diff --git a/client/index.html b/client/index.html index d67a65b..2a1b1d3 100644 --- a/client/index.html +++ b/client/index.html @@ -5,24 +5,12 @@ bworld