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

Vue Icon cut off #795

Closed
3 tasks done
pwang2 opened this issue Feb 22, 2022 · 10 comments
Closed
3 tasks done

Vue Icon cut off #795

pwang2 opened this issue Feb 22, 2022 · 10 comments

Comments

@pwang2
Copy link

pwang2 commented Feb 22, 2022

🗹 Requirements

image

  • I have searched the issues for my issue and found nothing related and/or helpful
  • I have searched the FAQ for help
  • I have searched the Wiki for help

🎯 Subject of the issue

Experienced behavior:
Vue icon is cutoff but others looked okay.

image
Might be a Neovim thing as it looks okay if I output via Unicode.
image
If I use Unicode to input in neovim and append a space , still not okay.
image

a few more icons have the same issue
image

🔧 Your Setup

  • Which font are you using (e.g. Anonymice Powerline Nerd Font Complete.ttf)?
  • Which terminal emulator are you using (e.g. iterm2, urxvt, gnome, konsole)?
    Windows Terminal
  • Are you using OS X, Linux or Windows? And which specific version or distribution?
    Microsoft Windows [Version 10.0.19042.1466]

Expected behavior:
aligned. also quite appreciated if anyone could provide guidance for a self-patch solution.

@Finii
Copy link
Collaborator

Finii commented Feb 23, 2022

Complete 'your setup' section missing.

@pwang2
Copy link
Author

pwang2 commented Feb 23, 2022

@Finii , Sorry about that, I have updated in the issue detail.

@Finii
Copy link
Collaborator

Finii commented Feb 23, 2022

I believe Windows Terminal, is that not prescribing fixed widthes?

I tried both the one in the patched folder in the repo and the one download from
https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/JetBrainsMono.zip

I can not find the Light font in the release 2.1.0 download.

Tried from the repo and ended up with this:
https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/Ligatures/Light/complete/JetBrains%20Mono%20Light%20Nerd%20Font%20Complete%20Windows%20Compatible.ttf

image

The font has the icons added 'big', i.e. more than one monospace-space wide (Note 832 vs 600 in image above). Windows Terminal scales them down for you, depending on glyph range.

From the 2.1.0 release here the Regular as example:

image

There both are 600 wide, but the symbol extrudes a bit to the right (into the next character). That is preserved by Windows Terminal.

Some explanations about the differences can be found in #731 and #764.
There is also an Issue where I examine the Windows Terminal behavior to some length (with source code snippets), but I can not find it 😒

Your expected behavior, I guess, can be achieved by using Font Flavior 1, the BlahBlah NF Mono variant, i.e. JetBrains Mono Light Nerd Font Complete Mono Windows Compatible.ttf (note two times Mono in the name).

If you try things out,

  • remove all 'old' fonts (i.e. from a different source) from that font family first (do not install over old fonts)
  • install the least amount of family member (ideally only one), because there are still family grouping issues (PR is ready)

@Finii
Copy link
Collaborator

Finii commented Feb 23, 2022

P.S. You run neovim within Windows Terminal or this GUI thing? If there is an issue related to a specific (sub-) application a description of the setup would be helpful.
Hmm, is there even a neovim-GUI-Windows build? Who knows ;-) I use neovim Appimage inside tilix under Gnome ;-D

@pwang2
Copy link
Author

pwang2 commented Feb 23, 2022

Thanks for the detailed investigation which is helpful. Really appreciate your time.

There is WSL in the middle. no GUI.

And you guess is right, here are some interesting results I tested with your direction.
image

Even more bizarre, if I open neovim --clean and then open a neovim split term://zsh inside the clean neovim and load my init.vim, it's also okay.

Let me try to get rid off any variants and clean the Font Cache. I would update if anything changes.

Below is my init.vim if you feel interested to check if anything interesting there. (FYI: I am in the middle of moving to lua. )
https://gist.github.com/pwang2/f0ad56df469d3e4ea6d187fefdae2ae1
https://gist.github.com/pwang2/d3c6cdf14d4495b5b34e36e4b4ebf537

@pwang2
Copy link
Author

pwang2 commented Feb 23, 2022

I think I found it. it is the guibg in highlight group in the colorscheme mask the right part.
image
image

But still, it'd kinda bizarre as this only affects some of the icons. icons like NPM here is not affected.

@Finii
Copy link
Collaborator

Finii commented Feb 24, 2022

But still, it'd kinda bizarre as this only affects some of the icons. icons like NPM here is not affected.

I guess NPM is in the 'wide' area and therefore 2 slots wide. Here you can check if Windows Terminal thinks the glyph is narrow or wide (or ambiguous):
https://github.com/microsoft/terminal/blob/main/src/types/CodepointWidthDetector.cpp

@pwang2
Copy link
Author

pwang2 commented Feb 24, 2022

vue hex is fd42 which is Unspecified.

UnicodeRange{ 0xf900, 0xfaff, CodepointWidth::Wide },
UnicodeRange{ 0xfe00, 0xfe0f, CodepointWidth::Ambiguous },

npm hex is e71e which is Ambiguous.

UnicodeRange{ 0xe000, 0xf8ff, CodepointWidth::Ambiguous }

I guess the unspecified is causing this issue. All icons in range fdxx have the same rendering issue which proves it.

Thanks for the investigation and I really learned a lot.

@Finii
Copy link
Collaborator

Finii commented Feb 25, 2022

it is the guibg in highlight group in the colorscheme mask the right part

Ah, I remember someone wrote that "the 'aligning' is done only on color changes".

Here: #746 (comment)

Konsole apparently only realigns to the grid on color changes.

While Konsole != Windows Terminal of course... hmm.

Terminal emulators get more and more 'smart' 🙄 Guess we soon need a Terminal Emulator Issues FAQ.

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants