Open MightyPork opened 7 years ago
Best case scenario:
So I tried writing some code for this, and I have to ask: how big can it be? Because the amount of code to render all that is—while it does have a repeating pattern—a lot
if it's over say 50 kB minified, that wouldn't be ideal, but there is still space left.
I'd write it like
drawLines(top, right, bottom, left) { // <- eg. 0 - none, 1 - single, 2 - thicc, 3-double
a bunch of horrible ifs
}
and then a switch that calls drawLines for each point ...
if you gzip the output folder (without the humongous sourcemap, .orig
and other junk files), + around 240 kB of code, it should ideally fit in 500 kB
technically there is 1 MB available, but if I ever want to implement OTA update, only half can be used
Added: https://github.com/espterm/espterm-front-end/commit/a79b08a16bfe5f3be7e97b78a3d39c05db247751
However, there's one remaining issue; the characters in the 0x2552–0x256C range are slightly wrong (right is unicode):
...also, term_screen.js is now a whopping 1758 lines
it looks like trash in my chrome
I'll try to move this onto a branch so I can make a release even if it's not finished
there, it's on branch box-drawing
.
also I force-pushed to work
so pls update your ref
Oh dear, @1x ruins everything
maybe adding +0.5 everywhere can fix that
nope, then it'd just break if your system has a different font
i think i'll try to redo this using rects, they worked nicely for the block chars
hm, maybe? You might want to round the center so that it’s on a whole-pixel value if the DPR is 1 or lower
maybe it would look nice, idk about the speed and also it'll be a pain cause there are over 100 of them
mind, we don't need all of them for sure (namely I don't care about the halflings and probably dont need bold ones if we have the thin ones that are more common)