microsoft / terminal

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

Nerd fonts overlap incorrectly #15594

Closed TheGamer1002 closed 1 year ago

TheGamer1002 commented 1 year ago

Windows Terminal version

1.17.11461.0

Windows build number

10.0.22621.0

Other Software

Technically, this can be reproduced in literally anything, but I first experienced it in the powerlevel10k installer in wsl.

Steps to reproduce

  1. Use a nerd font that is dynamic (i.e. not mono)
  2. Paste the following (gotten from powerlevel10k initialization screen): XXXXXXXXX
  3. Notice that the icons do not fit between the crosses

Expected Behavior

According to the initialization script, the icons should be very close to the crosses, but there should be no overlap.

Actual Behavior

The icons overlap with the crosses. image

237dmitry commented 1 year ago

In other terminals is the same. Tested on linux in Tilix, xfce4-terminal and alacritty.

TheGamer1002 commented 1 year ago

That's odd. I've had success with WezTerm in the past.

lhecker commented 1 year ago

But did you use the same non-Mono (non-NFM) font in WezTerm? Because those glyphs are 2 columns wide and WezTerm defaults to simply cutting their right half off (see allow_square_glyphs_to_overflow_width). Most terminals I know draw these non-NFM glyphs either the way it looks like in your screenshot or cut them off to only occupy 1 column. This is why many powerline setups append a single whitespace after such glyphs. This will allow these wide glyphs to be drawn in 2 columns without any apparent overlap. If you use the NF variant, responding with "No. Some icons overlap neighbouring crosses." is completely fine and expected as far as I know.

TheGamer1002 commented 1 year ago

Hm, I suppose I stand corrected. Maybe my Linux box is using the NL variation, though in that I saw that the icons fit snugly into the crosses (the end of one X came just after the start of an icon). I might be going crazy 🙃

lhecker commented 1 year ago

I'm fairly certain that the above rendering is expected for the non-Mono variant. I'll close the issue, but please let me know if you find any reproducible issues with it after all. 🙂