Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double wide nerd font glyphs are rendered incorrectly in 1.21 #17228

Closed
SivanagBalla opened this issue May 9, 2024 · 8 comments
Closed

Double wide nerd font glyphs are rendered incorrectly in 1.21 #17228

SivanagBalla opened this issue May 9, 2024 · 8 comments
Labels
Area-Fonts Related to the font Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal. Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons.

Comments

@SivanagBalla
Copy link

SivanagBalla commented May 9, 2024

Windows Terminal version

1.21.1272.0

Windows build number

10.0.22631

Other Software

No response

Steps to reproduce

Use UbuntuMono Nerd Font and configure some double wide character in status bar or print them in terminal

Issue seen with Latest Windows Terminal Preview version: 1.21.1272.0

Expected Behavior

Double wide fonts should be rendered properly like below

In Windows Terminal version: 1.19.11213.0 (Atlas Engine is enabled)

image
image

Actual Behavior

In Windows Terminal Preview version: 1.21.1272.0
With Graphics API: Direct3D 11 (Same result wtih Graphics API: Automatic) - some fonts are good but some are not

image
image

With Graphics API: Direct2D. The result is better but not same as 1.19.11213.0
image
image

In full screen mode, it get a bit worse
image

@SivanagBalla SivanagBalla added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 9, 2024

This comment was marked as off-topic.

@lhecker
Copy link
Member

lhecker commented May 10, 2024

Huh, weird. I thought those triangle glyphs were narrow (1 cell wide)? I just installed the latest version of Ubuntu Mono NF (version 0.80) and U+E0B8, U+E0BA, U+E0BC, and U+E0BE are all narrow for me.

What Ubuntu Mono font are you using? NF (UbuntuMonoNerdFont-Regular.ttf), NFM (UbuntuMonoNerdFontMono-Regular.ttf), or NFP (UbuntuMonoNerdFontPropo-Regular.ttf)?

Can you figure out what codepoints your status line uses, or otherwise give me a printf command (or similar) that allows me to reproduce the issue locally?

@lhecker lhecker added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 10, 2024
@SivanagBalla
Copy link
Author

I'm using an earlier verion of Ubuntu Mono NF which i downloaded from https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/UbuntuMono/Regular/UbuntuMonoNerdFont-Regular.ttf
This version has those characters(U+E0B8, U+E0BA, U+E0BC, and U+E0BE) to be double wide.

Sometime down the line (around year back i believe), they (ryanoasis/nerd-fonts) updated those characters to be narrow. So the latest version still have them as narrow.

I kept the older version of font file. Here it is. If you want to try this, you may want to remove the already installed one.
UbuntuMono Nerd Font.zip

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 10, 2024
@zadjii-msft
Copy link
Member

There's a couple ways I could see us taking this:

  • This is by-design, the PL glyphs are supposed to be single-wide now, and the terminal is correctly rendering them as such. Users can always opt-out of the Terminal doing this with "font.builtinGlyphs": false...
  • ... though, with "font.builtinGlyphs": false, we still should probably render these a little better
  • alternatively, I'm not sure if we can check the font ahead of time, and manually scale our PL drawing to the same width the font expects them to be

@zadjii-msft zadjii-msft added Area-Fonts Related to the font Product-Terminal The new Windows Terminal. labels May 10, 2024
@lhecker
Copy link
Member

lhecker commented May 10, 2024

Users can always opt-out of the Terminal doing this with "font.builtinGlyphs": false...

FYI you can also find the setting here:
image

I think we should consider closing this as "by design" for the following reasons:

  • Newer version of NF have these glyphs as narrow.
  • Adjusting the width of builtin glyphs to match the font would break their biggest strength of being fully "gap-less".
  • Adjusting the size of font glyphs in the past has repeatedly proven itself to be very error prone. Adjusting the vertical/horizontal alignment is less bad, but still somewhat error prone. It should be reserved to situations where there aren't any alternatives.

@SivanagBalla Is there a reason why you don't want to use a newer Ubuntu Mono NF version?

@lhecker lhecker changed the title Double wide nerd font glyphs are redenred properly with latest preview version Double wide nerd font glyphs are rendered incorrectly in 1.21 May 10, 2024
@SivanagBalla
Copy link
Author

I liked the older double wide verison of these characters and so i kept it.
Anyway, turning off Builtin Glyphs worked. This is good enough for me. But does this option have any other side effects?

@lhecker
Copy link
Member

lhecker commented May 10, 2024

No, it simply disables these builtin glyphs:
image

The benefit of them being builtin is that they're "pixel perfect", unlike the corresponding glyphs in a font.

@zadjii-msft
Copy link
Member

Yea I second closing by design. If disabling the builtin glyphs works for you, that's probably the best we'll be able to do in the general case.

Thanks for following up! TIL that there was a version of NF where those glyphs were double-wide

@zadjii-msft zadjii-msft closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
@zadjii-msft zadjii-msft added the Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons. label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Fonts Related to the font Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal. Resolution-By-Design It's supposed to be this way. Sometimes for compatibility reasons.
Projects
None yet
Development

No branches or pull requests

3 participants