microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
94.17k stars 8.16k forks source link

Atlas Engine fails to colour a character at certain text sizes #16585

Open marioparaschiv opened 5 months ago

marioparaschiv commented 5 months ago

Windows Terminal version

1.18.3181.0

Windows build number

10.0.22631.0

Other Software

starship 1.17.1

Steps to reproduce

Attempt with AtlasEngine text renderer set to off and you should notice that it no longer fails to colour the character.

Expected Behavior

Arrow should stay green.

Actual Behavior

https://github.com/microsoft/terminal/assets/98427312/8f2fee76-2491-4568-89a2-dd875e4d7ab8

DHowett commented 5 months ago

@lhecker looks like glyph overhangs are being miscolored sometimes

lhecker commented 5 months ago

The reason this occurs is so that we can draw ligatures like <-!-- in multiple colors like so: image

For now, I would suggest circumventing this issue by changing your starship prompt like so:

"[➜ ](bold green)"

Let me know if that doesn't work!

Fixing the issue on the other hand seems a little difficult. I could make this behavior a little bit more consistent though by using the design width of the glyph (as float) instead of comparing the exact integer pixel width. (That's what's causing the flickering - the ➜ glyph in that font is exactly 1.5 cells wide which causes rounding issues like that.)

marioparaschiv commented 5 months ago

That seemed to do the trick for now, thank you!