Incorrect rendering of DEC Special Graphics, which is used in ncurses Nethack
leonyu opened this issue · 6 comments
DEC Special Graphics characters are rendered incorrectly.
This can be produced by the following oneliner:
python3 -c 'for i in range(95, 127): print(f"{i:x} | \x1b(0{chr(i) * 4}\x1b(B | {i:x}")'
https://asciinema.org/a/6wW8RLBjuampesVCrbDUEjX62
These characters are used by ncurses Nethack:
I don't know if there's a wholistic solution for this. I think VS Code had similar issue and switched to use canvas for terminal rendering. I think they use Xterm.js.
Yeah, holistic solution is a holy grail :) It's just browsers render text differently, and I'm afraid without switching to canvas + carefully selected set of font faces there will always be something off. There's no plan for canvas impl in short term but in long term we may go there.
It is also possible to detect the rendering size of the characters using Canvas/OffscreenCanvas then make adjustments with rendering accordingly.
That's interesting idea 💡