p10k prompt is not displayed correctly with AtlasEngine #21201

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

Originally created by @Mystic8b on GitHub (Feb 4, 2024).

Windows Terminal version

1.19.10302.0

Windows build number

22631.3085

Other Software

WSL Ubuntu latest
ZSH
p10k (rainbow theme)
MesloLGS Nerd Font (from p10k repo)
9px font size

Steps to reproduce

Setup zsh, p10k, set rainbow theme by using p10k configure
Select MesloLGS NF with a font size of 9px in the terminal settings with AtlasEngine enabled.

Expected Behavior

Smooth borders of the prompt, like in this screenshot with AtlasEngine disabled
image

Actual Behavior

Incorrect prompt rendering
image

Originally created by @Mystic8b on GitHub (Feb 4, 2024). ### Windows Terminal version 1.19.10302.0 ### Windows build number 22631.3085 ### Other Software WSL Ubuntu latest ZSH p10k (rainbow theme) MesloLGS Nerd Font (from p10k repo) 9px font size ### Steps to reproduce Setup `zsh`, `p10k`, set rainbow theme by using `p10k configure` Select `MesloLGS NF` with a font size of 9px in the terminal settings with AtlasEngine enabled. ### Expected Behavior Smooth borders of the prompt, like in this screenshot with AtlasEngine disabled ![image](https://github.com/microsoft/terminal/assets/35394377/9098e73d-ff97-401e-8b2d-ca633fd149be) ### Actual Behavior Incorrect prompt rendering ![image](https://github.com/microsoft/terminal/assets/35394377/6b9d2921-1cf1-446d-96fd-2a7ce240ca61)
Author
Owner

@lhecker commented on GitHub (Feb 6, 2024):

Given your font size of 9pt (FYI: not px - our font sizes are in pt) and an apparent line height of 15 pixels, I'm assuming that you're using a display scale of 100%, right?

In that case, please delete your Meslo NF font and then download and install the latest version here: https://www.nerdfonts.com/font-downloads (At the time of writing the direct link is: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/Meslo.zip)

This is because I found that the issue you've described does not occur on my PC in that case:
image

But you can see there that the "s" in ssh has the exact same pixel height as yours and the white box is also 15px tall. BTW this is super opinionated, but I personally definitely recommend enabling ClearType if you're using a 100% scale monitor. It'll add a somewhat ugly blue line in the rounded box, but it'll make the text a lot more legible in my opinion.

That aside, you can set fractional font sizes which allows you to solve this issue under most circumstances.

Lastly, I consider this an issue with the font itself, as we simply draw the glyphs exactly as they were designed. The only text renderer simply didn't have this issue because it cut off any overly large glyphs or distorted them if necessary. That has caused a ton of issues in the past and I personally don't wish to open that can of worms again. 😟 But this is a common issue with a lot of fonts (including our own Cascadia Code), and we intend to ship this workaround at some point: #5897

As such I'll close this issue for now and I'd suggest upvoting and following #5897 if you're interested in seeing this resolved properly in the future (we loosely use upvotes to see what features to implement in the future).

@lhecker commented on GitHub (Feb 6, 2024): Given your font size of 9pt (FYI: not px - our font sizes are in pt) and an apparent line height of 15 pixels, I'm assuming that you're using a display scale of 100%, right? In that case, please delete your Meslo NF font and then download and install the latest version here: https://www.nerdfonts.com/font-downloads (At the time of writing the direct link is: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/Meslo.zip) This is because I found that the issue you've described does not occur on my PC in that case: ![image](https://github.com/microsoft/terminal/assets/2256941/247e7719-c026-480b-b49f-6cb93a1a88d4) But you can see there that the "s" in ssh has the exact same pixel height as yours and the white box is also 15px tall. BTW this is super opinionated, but I personally definitely recommend enabling ClearType if you're using a 100% scale monitor. It'll add a somewhat ugly blue line in the rounded box, but it'll make the text a lot more legible in my opinion. That aside, you can set fractional font sizes which allows you to solve this issue under most circumstances. Lastly, I consider this an issue with the font itself, as we simply draw the glyphs exactly as they were designed. The only text renderer simply didn't have this issue because it cut off any overly large glyphs or distorted them if necessary. That has caused a ton of issues in the past and I personally don't wish to open that can of worms again. 😟 But this is a common issue with a lot of fonts (including our own Cascadia Code), and we intend to ship this workaround at some point: #5897 As such I'll close this issue for now and I'd suggest upvoting and following #5897 if you're interested in seeing this resolved properly in the future (we loosely use upvotes to see what features to implement in the future).
Author
Owner

@Mystic8b commented on GitHub (Feb 6, 2024):

This is because I found that the issue you've described does not occur on my PC in that case:

Your example has the same problem. One pixel bottom part is missing
image

I have already tried all variations of this font, there are problems everywhere. And the problems are only when using AtlasEngine. And you released it with the default renderer. You must fix this.

P10k uses its own version of the font and the developer says that the problem is in the terminal.

@Mystic8b commented on GitHub (Feb 6, 2024): > This is because I found that the issue you've described does not occur on my PC in that case: Your example has the same problem. One pixel bottom part is missing ![image](https://github.com/microsoft/terminal/assets/35394377/20f5dfb5-eaa2-4109-a22f-858c4fef82ac) I have already tried all variations of this font, there are problems everywhere. And the problems are only when using AtlasEngine. And you released it with the default renderer. You must fix this. P10k uses its own version of the font and the developer [says](https://github.com/romkatv/powerlevel10k/issues/2557#issuecomment-1925877628) that the problem is in the terminal.
Author
Owner

@lhecker commented on GitHub (Feb 6, 2024):

I believe it's important to mention that your screenshot is exactly how DirectWrite renders that glyph and there's no missing pixel on our end:
image

I do think it's weird though that the last row of pixels seems like it gets cut off by DirectWrite. I'll investigate why that occurs and if it's something we do wrong, I'll reopen this issue and use it to track a fix for the missing pixels.


That aside, I always agreed that this is an issue with Windows Terminal and that it needs to be fixed urgently, if possible. But in my opinion #5897 presents the best path towards fixing the issue and that's why I closed your issue, as I considered it to be a duplicate. I don't mean to ignore your issue and I apologize if it felt that way.

It's correct that we used to special case powerline glyphs in the past, but the way we did it was to "scale" glyphs to perfectly fit their box. This had a lot of subtle problems: "pixel perfect" fonts failed to work, font fallback didn't work correctly, and sometimes glyphs were misaligned. A lot of people complained about it over the years. Here's some: #8993, #13527, #13662, #14877

Scaling glyphs like that is something no other terminal did. If anything, they all use a technique as described in #5897 as it has none of the issues above, so I'll use #5897 to track a fix for this. I'll see if I can get it done sooner rather than later.

@lhecker commented on GitHub (Feb 6, 2024): I believe it's important to mention that your screenshot is exactly how DirectWrite renders that glyph and there's no missing pixel on our end: ![image](https://github.com/microsoft/terminal/assets/2256941/50cb2342-9c0d-4f04-a654-0fa2dbbca548) I do think it's weird though that the last row of pixels seems like it gets cut off by DirectWrite. I'll investigate why that occurs and if it's something we do wrong, I'll reopen this issue and use it to track a fix for the missing pixels. --- That aside, I always agreed that this is an issue with Windows Terminal and that it needs to be fixed urgently, if possible. But in my opinion #5897 presents the best path towards fixing the issue and that's why I closed your issue, as I considered it to be a duplicate. I don't mean to ignore your issue and I apologize if it felt that way. It's correct that we used to special case powerline glyphs in the past, but the way we did it was to "scale" glyphs to perfectly fit their box. This had a lot of subtle problems: "pixel perfect" fonts failed to work, font fallback didn't work correctly, and sometimes glyphs were misaligned. A lot of people complained about it over the years. Here's some: #8993, #13527, #13662, #14877 Scaling glyphs like that is something no other terminal did. If anything, they all use a technique as described in #5897 as it has none of the issues above, so I'll use #5897 to track a fix for this. I'll see if I can get it done sooner rather than later.
Author
Owner

@lhecker commented on GitHub (Feb 6, 2024):

The bottom pixels are cut off because DirectWrite defaults to DWRITE_RENDERING_MODE_DEFAULT which seems to ignore the GASP table at small font sizes. If I explicitly use DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC it works as expected:
image

If more people would be interested in making this configurable, we could consider adding it as a setting. Right now, I'm not sure whether there's any benefit to making this configurable, since it doesn't address the powerline issue.

@lhecker commented on GitHub (Feb 6, 2024): The bottom pixels are cut off because DirectWrite defaults to `DWRITE_RENDERING_MODE_DEFAULT` which seems to ignore the GASP table at small font sizes. If I explicitly use `DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC` it works as expected: ![image](https://github.com/microsoft/terminal/assets/2256941/8a593aba-50a7-4fdb-8188-e763f1c5c5b5) If more people would be interested in making this configurable, we could consider adding it as a setting. Right now, I'm not sure whether there's any benefit to making this configurable, since it doesn't address the powerline issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21201