Rendering of some escape codes are broken on some fonts #19413

Closed
opened 2026-01-31 06:42:36 +00:00 by claunia · 4 comments
Owner

Originally created by @HarukaMa on GitHub (Feb 19, 2023).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.16.10261.0, also main branch

Windows build number

10.0.19044.2364

Other Software

Most TUI programs

Steps to reproduce

The screenshot below uses make menuconfig on Linux kernel source and tool aptitude, but many TUI applications show this behavior as well. Try using some with specific fonts and you will spot it.

Expected Behavior

Might be the most ambiguous issue title I've written in a while, but I'm not quite sure what's causing it. I'll explain below.

(Warning, lots of screenshots)

When using common monospaced fonts, the rendering is fine:

Consolas:
image

Lucida Console:
image

and a third-party one:

MxPlus IBM VGA font:
image

Actual Behavior

However, when using some fonts (didn't find out the specifics here), the rendering is borked. Notice that the checkboxes are not aligned anymore, some characters are missing, and the window borders are broken:

PC-98 font:
image

That's a third-party font, however some standard fonts are showing this as well:

SimHei:
image

MS Gothic:
image

Tried with AtlasEngine both on and off and nothing changed (it didn't need a restart right?).

Originally created by @HarukaMa on GitHub (Feb 19, 2023). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.16.10261.0, also main branch ### Windows build number 10.0.19044.2364 ### Other Software Most TUI programs ### Steps to reproduce The screenshot below uses `make menuconfig` on Linux kernel source and tool `aptitude`, but many TUI applications show this behavior as well. Try using some with specific fonts and you will spot it. ### Expected Behavior Might be the most ambiguous issue title I've written in a while, but I'm not quite sure what's causing it. I'll explain below. (Warning, lots of screenshots) When using common monospaced fonts, the rendering is fine: Consolas: ![image](https://user-images.githubusercontent.com/861659/219931690-7a13f67b-e97d-435a-97f0-106b67621d79.png) Lucida Console: ![image](https://user-images.githubusercontent.com/861659/219931703-75769b39-4055-4327-8f39-b7e85a968c8f.png) and a third-party one: MxPlus IBM VGA font: ![image](https://user-images.githubusercontent.com/861659/219931901-5bb80f2d-86b5-417b-a0a5-3b794ffeee16.png) ### Actual Behavior However, when using *some* fonts (didn't find out the specifics here), the rendering is borked. Notice that the checkboxes are not aligned anymore, some characters are missing, and the window borders are broken: PC-98 font: ![image](https://user-images.githubusercontent.com/861659/219931792-d80b42d1-6d6f-4313-8b7b-f09c6e3a9ff3.png) That's a third-party font, however some standard fonts are showing this as well: SimHei: ![image](https://user-images.githubusercontent.com/861659/219931931-a73145e2-3509-49f0-94ce-37e5f99e33a1.png) MS Gothic: ![image](https://user-images.githubusercontent.com/861659/219931988-188c0d65-5e95-441e-9c62-00019c74a3f9.png) Tried with AtlasEngine both on and off and nothing changed (it didn't need a restart right?).
Author
Owner

@HarukaMa commented on GitHub (Feb 19, 2023):

Forgot about the aptitude example, but it's like this:
image

@HarukaMa commented on GitHub (Feb 19, 2023): Forgot about the `aptitude` example, but it's like this: ![image](https://user-images.githubusercontent.com/861659/219932144-3bddcb63-26b8-4eae-a07e-3c68e35cb640.png)
Author
Owner

@zadjii-msft commented on GitHub (Feb 20, 2023):

Tried with AtlasEngine both on and off and nothing changed (it didn't need a restart right?).

FWIW it absolutely does require a restart of that tab, unfortunately. One of the few settings that can't hot-reload. Double checking these results with it both enabled and disabled might help point at the right root cause.

I'm sure there's a dupe laying around that @lhecker can find. Probably one for each of the renderers 😅

@zadjii-msft commented on GitHub (Feb 20, 2023): > Tried with AtlasEngine both on and off and nothing changed (it didn't need a restart right?). FWIW it absolutely does require a restart of that tab, unfortunately. One of the few settings that can't hot-reload. Double checking these results with it both enabled and disabled might help point at the right root cause. I'm sure there's a dupe laying around that @lhecker can find. Probably one for _each_ of the renderers 😅
Author
Owner

@HarukaMa commented on GitHub (Feb 20, 2023):

Just tried and the rendering is broken on both situations:

AtlasEngine off:
image

AtlasEngine on:
image

Also it might be a good idea to add a description below to indicate that this specific setting needs a restart (or a new tab) to take effect:
image

@HarukaMa commented on GitHub (Feb 20, 2023): Just tried and the rendering is broken on both situations: AtlasEngine off: ![image](https://user-images.githubusercontent.com/861659/220117671-672c8df3-a966-462b-b2d3-29bf9a35aa74.png) AtlasEngine on: ![image](https://user-images.githubusercontent.com/861659/220117702-284cc7fa-11f6-4d38-a9d6-80f565610e92.png) Also it might be a good idea to add a description below to indicate that this specific setting needs a restart (or a new tab) to take effect: ![image](https://user-images.githubusercontent.com/861659/220117943-a71fbed6-7653-4e57-be16-1c37f22cb0d4.png)
Author
Owner

@lhecker commented on GitHub (Mar 6, 2023):

I'm about to open a PR which improves the situation around such box drawing characters up to the point, where we draw to the best capabilities of the font you've chosen. If the font doesn't have proper box drawing characters, they'll look broken, because that's what the font tells us to do. This is for instance the case for MS Gothic, where the right border in make menuconfig will appear invisible, because that's what MS Gothic tells us to do:
image

For further improvements we'll have to wait for #5897.

@lhecker commented on GitHub (Mar 6, 2023): I'm about to open a PR which improves the situation around such box drawing characters up to the point, where we draw to the best capabilities of the font you've chosen. If the font doesn't have proper box drawing characters, they'll look broken, because that's what the font tells us to do. This is for instance the case for MS Gothic, where the right border in `make menuconfig` will appear invisible, because that's what MS Gothic tells us to do: ![image](https://user-images.githubusercontent.com/2256941/223165330-f65b962f-8ee3-447a-8843-4d4aaf572c1c.png) For further improvements we'll have to wait for #5897.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19413