xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.04k stars 1.6k forks source link

Introduce opt-in glyph scaling to achieve GB18030 compliance #4997

Closed Tyriar closed 4 months ago

Tyriar commented 4 months ago

Fixes #4969

I've tried to keep the overhead for the webgl renderer as small as possible, there's just a check for an option (via optimized rawOptions) and fetching the width of each cell from content.

Webgl with the setting off:

image

Webgl with the setting on:

image

I looked into dynamically resizing based on the following glyph but it ended up feeling weird seeing the glyphs change. The VIII in particular seems pretty hard to read which is probably a combination of letting the GPU handle interpolation (good for perf but it might be using nearest pixel?) and it tries to pack a lot of stuff into a small cell on a standard DPI screen (high DPI would be fine).

The setting is opt-in in xterm.js and the plan is to enable it by default in VS Code.