Open rhaskia opened 8 months ago
I am willing to fix this myself, but I cannot find where this rendering happens inside the codebase.
It seems that the code that is responsible for making double-width/height text is in the TermWindow.render_screen_line()
function, starting at line 50 of wezterm-gui/src/termwindow/render/screen_line.rs
, to wit:
let width_scale = if !params.line.is_single_width() {
2.0
} else {
1.0
};
let height_scale = if params.line.is_double_height_top() {
2.0
} else {
1.0
};
let cell_width = params.render_metrics.cell_size.width as f32 * width_scale;
let cell_height = params.render_metrics.cell_size.height as f32 * height_scale;
Basically, for double-width and double-height text, it doubles just the character cell width or both the character cell width and height, respectively. While I haven't yet had time to dig into where characters get rendered (and so am basing this mostly on speculation), I suspect the root of the problem lies here. I'd guess that scaling the character size like this results in each character getting rendered at 1× size and then scaled up to 2× normal size, resulting in the pixelation.
I'll have to look further into the rendering code to figure out where in the chain relative to render_screen_lines()
the characters get rendered and how easy it would be to change the rendering code to double the font size for double-height/width text rather than scale up normal-size text.
What Operating System(s) are you seeing this problem on?
Windows
Which Wayland compositor or X11 Window manager(s) are you using?
No response
WezTerm version
wezterm 20240316-074238-889f8a9c
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version of the nightly that I tried
Describe the bug
Double height/width text renders at the wrong font size, seemingly scaled up from normal size to fit two lines. I'm assuming this might be because of how the app caches glyphs, but I wouldn't be sure.
To Reproduce
On WSL, put in the command
echo -e "\x1b#3large"
. In powershell, the commandecho "`e#3large"
works similarly.Configuration
Expected Behavior
For the outputted line's glyphs to be scaled correctly at double width/height, ideally double the font size of the config.
Logs
No response
Anything else?