ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
54.08k stars 3.63k forks source link

Vue Icon cut off #795

Closed pwang2 closed 2 years ago

pwang2 commented 2 years ago

🗹 Requirements

image

🎯 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

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

Finii commented 2 years ago

Complete 'your setup' section missing.

pwang2 commented 2 years ago

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

Finii commented 2 years ago

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 :unamused:

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,

Finii commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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: https://github.com/ryanoasis/nerd-fonts/issues/746#issuecomment-1003429782

Konsole apparently only realigns to the grid on color changes.

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

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

github-actions[bot] commented 1 year ago

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.