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
53.8k stars 3.62k forks source link

Some glyphs missing after v3.x.x update #1190

Closed luizkowalski closed 5 months ago

luizkowalski commented 1 year ago

🗹 Requirements

🎯 Subject of the issue

Experienced behavior: this morning I updated some deps on my computers and some fonts were updated as well but this is not a big deal since this has happened before, but after the update finished I noticed some icons on my neovim were wrong like the Gemfile icon and the X for closing a buffer:

image

This was weird so I decided to delete all custom fonts I had, clean up the cache, re-download them manually, and reinstall it. To my surprise, nothing has changed

No idea what is going on, this is my text configuration on iTerm2:

image

Neovim version:

:version
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.0/share/nvim"

No Neovim config has been changed prior to today or after this.

Expected behavior: X and missing icons should exist

Example symbols:

🔧 Your Setup

One more screenshot from other missing icons

image

I guess it should've been the "unknown file" icon

Finii commented 1 year ago

Can you try to copy and paste the missing-icon-characters into a comment as text here? I can determine the codepoints then.

dbuch commented 1 year ago

Right, I can confirm this problem.

Which font are you using (e.g. Anonymice Powerline Nerd Font Complete.ttf)?

Fira Code Nerd Font and Fira Code Nerd Font Mono

Same here.

Are you using OS X, Linux or Windows? And which specific version or distribution?

Linux (Arch linux)

Finii commented 1 year ago

I fear the missing icon are from the dropped Material Design Icons set. But we need the codepoints or the characters copy as text an pasted into a comment to see.

I also use neovim, I have never seen that gui-ish thing, what is the command to activate that?

luizkowalski commented 1 year ago

Couldn't copy but I guess I managed somehow to see some info when right-clicking with the mouse:

This one is the .rbi file, probably "unknown file" icon

image

This one was the close button:

image

I have never seen that gui-ish thing, what is the command to activate that?

That would be Telescope with git_files command

luizkowalski commented 1 year ago

Also, noticed that .svg files have this weird icon that looks like something in Arabic?

image image
Kedap commented 1 year ago

I think it's a problem with the icon pack like 'neovim-web-devicons' or packages like that. Something similar happens to me but with cascadia code (original) and also with fira code (Fira Code Nerd Font). In the first case I thought it was just a cascadia code error, so I installed CaskaydiaCove but the problem persists. This all started this morning when I decided to update, which is the same archlinux.

firacode_alfa_error

Captura de pantalla_2023-05-01_15-00-28 CaskaydiaCove NFM error nf-mdi-format_size error render Captura de pantalla_2023-05-01_14-56-35 The deprecated tag seems to indicate something

This is the same with other icons. But something curious is that Caskaydia is installed in kitty and FiraCode in wezterm and with wezterm if I can see the second icon text

I think a lot of popular icons are marked as deprecated and therein lies the problem. As far as I see what happens, I will continue to regret updating :(

luizkowalski commented 1 year ago

oh, good find! yeah, the X icon (F655) is obsolete too, which proves your point

Kedap commented 1 year ago

For example: https://github.com/onsails/lspkind.nvim/pull/64

luizkowalski commented 1 year ago

there is a PR for it already on nvim tree devicons too: https://github.com/nvim-tree/nvim-web-devicons/pull/264

Finii commented 1 year ago

Reason

Historically Nerd Fonts patched the Material Design Icons to codepoints F500 - FD46. The problem with part of these codepoints is that they are not 'free to use' (what Unicode calls PUA), but contain glyphs that are needed for some non-english languages. There are a lot issues raised, and rightfully so. The problem has been discussed at length here:

Additionally people wanted the Material Design Icons to update. The problem with that was that the number of icons increased considerably; and the MDI themselves moved codepoints to PUA-A. Several solutions have been discussed and what finally has been choosen was this:

Strategy

That moving codepoints would hurt you was clear. On the other hand imagine that someone stole you the capital letter A to put some obscure icon there. To lessen the hurt the new codepoints have been activated with Nerd Fonts v2.3.0 already and hinted that people should migrate to the new codepoints "now" (Compare its release notes):

Screenshot 2023-05-02 at 08 30 48

Some projects did it, some people wrote codepoint converters (unfortunately I did not compile a list, maybe we could do it in this thread). For sure most people did not see the release notes 🙄

To help people the icons have been tagged in the cheat sheet, and there is now a 'database' of the icons [1], and a rough translation list [2].

Finally with the major release the new codepoints (and new icons) are the only codepoints to reach the Material Design Icons:

[1] https://github.com/ryanoasis/nerd-fonts/blob/master/glyphnames.json [2] https://github.com/ryanoasis/nerd-fonts/issues/1059#issuecomment-1404891287 (open the details in this comment)

Edit: Add word 'raised' in 1st paragraph

Finii commented 1 year ago

Also, noticed that .svg files have this weird icon that looks like something in Arabic?

See 'reason' above. That codepoint IS the codepoint for that Arabic glyph. Imagine you want to write something and instead of the expected glyph (equivalent to letter A) you get some weird icon.

Well, I hope you will not be too angry and frustrated, understanding the reason. Nerd Fonts got that unfortunately wrong from the start, and at some point in time we should stick to the standard.

This one is the .rbi file, probably "unknown file" icon

Where does the rbifile come from (which project)? Some plugin? We should raise an issue there.

Finii commented 1 year ago

To help more we could show the replacement codepoint in the cheat sheet. Would that help?

But sometimes the updated MDI looks different (well that is the reason for the MDI update), or has been dropped completely meanwhile.

luizkowalski commented 1 year ago

Where does the rbifile come from (which project)? Some plugin? We should raise an issue there.

Ruby's Sorbet file type. Developers don't really touch this file, it is autogenerated and you are highly encourage to leave like this, that's why, personally, never bothered me the unknown file

rj1 commented 1 year ago

i'm experiencing the same/similar issue using the ttf-hack-nerd package on arch linux.

all of a sudden i'm missing a bunch of symbols that worked fine before, a few examples:

{ "", "", "", "", "", "" }
luizkowalski commented 1 year ago

@rj1 if I understand correctly (and Finii can correct me if I'm wrong cause I'm just learning all of this), it is not a Nerd Font's issue. It was announced previously that Material Icons (probably the missing symbols you are seeing) were to be deprecated due to them not being free. if anyone is to blame, is whatever library you are using to render these symbols (e.g. vim's devicons). You should go to their repository and check open issues

Finii commented 1 year ago

it is not a Nerd Font's issue

Well, it kind of is, but is not-a-bug. The symbols needed to change their codepoints.

deprecated due to them not being free

The icons were free and they are still there, but the codepoints were not free, they are needed for non-latin texts. To occupy codepoints that are not free-to-use has been an oversight years ago when non-latin texts were not a consideration.

You should go to their repository and check open issues

Definitively. Or raise an issue there. Link to this thread in your report there.

Finii commented 1 year ago

Collection of helper projects

https://github.com/loichyan/nerdfix https://gist.github.com/mischw/78e8e42c2ebb1069560a2fc4573b1425 https://github.com/ryanoasis/nerd-fonts/issues/1059#issuecomment-1404891287 (open details)

Big thanks to the respective authors!

rj1 commented 1 year ago

thx!

in my case it's just some symbols i've pasted from https://unicodes.jessetane.com/ into my neovim config

@mischw's python script is v helpful & managed to get most of them, but there's still a couple that either don't render or render something completely different than before :(

update: turns out the two symbols are now obsolete for some reason..

Icon 'nf-mdi-square_inc' is marked as obsolete
Icon 'nf-mdi-glassdoor' is marked as obsolete
rootex- commented 1 year ago

I can also confirm the problem:

Screenshot 2023-05-02 at 15 37 37

To compare it with another working font:

Screenshot 2023-05-02 at 15 36 32
rootex- commented 1 year ago

nerdfix utility has helped me to find missing symbols and replace them by hand

siduck commented 1 year ago

hi @Finii is this folder icon removed?

image

Copy it from site gives me another icon ( cuz the site isnt updated to v3.0 ) image

But i wasnt able to find it by fontforge too

Finii commented 1 year ago

They (octicons) obviously modernized/updated that glyph... We updated to the latest octicons with v3.0.0

image

Edit: Changed to more meaningful image

musjj commented 1 year ago

Are you sure that's just a modernized version? For example, the icon in the 4th column of the 2nd row, I can't imagine that the old and new version serves the same purpose. image

Finii commented 1 year ago

Some icons have been dropped without replacement. We 'compress' the glyph-map, so that newly added icons fill up the gaps. Otherwise we would run out of codepoints rather soon.

Here the update process log

Reading mapping file
Found 172 entries
Fetching octicons archive "v18.2.0.tar.gz"

Unpacking octicons archive
Found 574 svgs
Found 308 icons after de-duplicating

Renamed cloud-download -> download
Renamed cloud-upload -> upload
Renamed clippy -> paste
Renamed mail-read -> read
Renamed primitive-dot -> dot-fill
Renamed primitive-square -> square-fill
Renamed settings -> sliders
Renamed dashboard -> meter
Renamed trashcan -> trash
Renamed paintcan -> paintbrush

Missing octoface
Missing keyboard
Missing gist
Missing file-text
Missing file-pdf
Missing jersey
Missing radio-tower
Missing repo-force-push
Missing mail-reply
Missing arrow-small-right
Missing gist-secret
Missing no-newline
Missing arrow-small-up
Missing arrow-small-down
Missing arrow-small-left
Missing file-symlink-directory
Missing circuit-board
Missing watch
Missing text-size
Missing ellipses
Missing plus-small

Found 151 (of 172, missing 21) and new 157

Obviously keyboard has been dropped and we fill/reuse it's space with some newly added icon. See also #1156

siduck commented 1 year ago

They (octicons) obviously modernized/updated that glyph... We updated to the latest octicons with v3.0.0

image

Edit: Changed to more meaningful image

Can I make a new font with just the file-directory icon and set different endpoint for it? is this possible

musjj commented 1 year ago

There's a couple filled versions of the folder icon around the bottom right. Maybe use that?

siduck commented 1 year ago

There's a couple filled versions of the folder icon around the bottom right. Maybe use that?

I know that but I want this one only specifically, it looks good.

Atom used to use it, doom emacs uses it too

image

I've used it in my nvim config as well

image

Finii commented 1 year ago

Updated the cheat-sheet to (hopefully) communicate in a more clear way what happened:

image

This is how it looks like when following the example in the bottom, to find out where a removed glyph moved to:

image

And if you enter a codepoint you can see old and new content side by side (because the cheat-sheet secretly also loads the v2.3.3 font to be able to show the removed icons):

image

Hope this helps.

thyeun commented 1 year ago

After recent update, a branch of font change into chinese words, as you can see below.

Screenshot_2023-05-06-21-59-07_3658

Finii commented 1 year ago

After recent update, a branch of font change into chinese words, as you can see below.

@thyeun Great! So it does work! Finally we freed the Chinese words and one can write correctly. (I.e. this is wanted and needed and not a bug)

You probably need to follow the codepoint movement with your setup; there are several hint above.

yakomisar commented 1 year ago

@thyeun

How to fix broken icons.

My font - JetBrains Mono Nerd font.

If you encounter a broken icon (in my case - JetBrains Mono Nerd font), follow these steps:

  1. Find the broken icon, which is usually marked with a ? in a rhombus, ? in a square, or just a ? mark. For example:

    Снимок экрана 2023-05-10 в 10 37 10
  2. Go to the Nerd Fonts Cheat Sheet and locate the icon you want to use. Click on the "Copy UTF" button to copy the Unicode character code for the icon. Note that even if an icon is not marked as obsolete, it may still not work as expected. To check the visibility of the icon, proceed to step 3.

    Снимок экрана 2023-05-10 в 11 08 45
  3. Check the visibility of the icon using the following command in the terminal:

echo -e "\<your copied utf code>

Replace "" with the Unicode character code for the icon you want to use. If the icon is visible and appears correctly, you can use it in your script or configuration file.

Снимок экрана 2023-05-10 в 11 24 55
  1. Copy and paste the icon from the terminal wherever you want to use it.

  2. Enjoy your fixed icons!

thyeun commented 1 year ago

@yakomisar thanks, but i have better solution instead that using codepoint and check one by one from cheatsheet.

:)

lazzzaroni commented 1 year ago

Hi everyone! Can you help me to find proper replacement for this icons? It seems that they aren't properly scaled anymore for vim/tmux configs.

This is what I have with MesloLGS Nerd Font Mono 3.0: image

This is how it should look: image

Here are the glyphs that don't work correctly anymore:  

To be more precise, here's the theme which have this bug after moving to NF 3.0: https://github.com/jimeh/tmux-themepack/tree/master

Maybe someone already solve this problem?

Cheers!

siduck commented 1 year ago

Hi everyone! Can you help me to find proper replacement for this icons? It seems that they aren't properly scaled anymore for vim/tmux configs.

This is what I have with MesloLGS Nerd Font Mono 3.0: image

This is how it should look: image

Here are the glyphs that don't work correctly anymore:  

To be more precise, here's the theme which have this bug after moving to NF 3.0: https://github.com/jimeh/tmux-themepack/tree/master

Maybe someone already solve this problem?

Cheers!

Try https://github.com/loichyan/nerdfix

thyeun commented 1 year ago

@lazzzaroni are you using arch linux? if yes, there have a repos for the nerd font complete v2.2, it work for me to get back all the font i need.

Finii commented 1 year ago

Here are the glyphs that don't work correctly anymore:  

E0B0 etc are off-topic here. I move this to another topic. They have not changed codepoints. The problem looks like wrong scaling instead.

saikete commented 1 year ago

As a novice, I followed the Nvchad official documentation to install nerdfont, and then enabled Nvchad in the iterm2 terminal and made some my own configurations, and then there were problems such as the search icon not appearing, but the problem did not occur in the GUI, and I felt that it might be some configuration in iterm2 problem, but I haven't found a solution so far. . .

image image image
thyeun commented 1 year ago

@saikete You missing out of the search glyph? i replace that with the e68f, original search glyph f002 always given issue after each time new update.

And one thing to check with you, are you using same font for your GUI and Nvim?

saikete commented 1 year ago

I think replacing characters manually is a lot of work, which is fine when there are few characters, but not a good solution when there are quite a lot of wrong characters

My GUI is using neovide. In fact, I have not confirmed what font is used by the GUI without setting the font! According to my understanding, the default font of the terminal should be used? I'm not sure about this. Another reason why I don't use the terminal now is that I can't capture the key. I use mac+hhkb, so I will miss a lot of interesting keys. I have submitted an issue, in short, I am still confirming where the problem is that the font is difficult to display,,,

https://github.com/neovide/neovide/issues/1867

Finii commented 1 year ago

@saikete

I think replacing characters manually is a lot of work, which is fine when there are few characters, but not a good solution when there are quite a lot of wrong characters

Maybe one of the helpers can be used?

wez commented 1 year ago

Sort of related to this, in wezterm, there is automation that scrapes the name -> symbol mapping from the various scripts in https://github.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/lib so that we can provide lua constants for them. After updating to 3.0.1 the various mdi symbols were stale because we read in https://github.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/lib/i_material.sh instead of https://github.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/lib/i_md.sh

It would be great if you could consider removing i_material.sh if it is no longer an accurate mapping!

(BTW: I'd love it if there was a json blob or similar that held the definitive mapping in a machine readable structure!)

saikete commented 1 year ago

与此相关,在 wezterm 中,有一种自动化功能可以从https://github.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/lib中的各种脚本中抓取名称 -> 符号映射,以便我们可以为他们提供lua常量。 更新到 3.0.1 后,各种 mdi 符号已过时,因为我们在https://github.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/lib/i_material.sh而不是https://github 中读取.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/lib/i_md.sh

如果您可以考虑删除 i_material.sh,如果它不再是一个准确的映射,那就太好了!

(顺便说一句:如果有一个 json blob 或类似的东西在机器可读结构中保存最终映射,我会很高兴!)

Sorry it took me a while to understand what you said, so first off, I'm using the iterm2 terminal, should I replace wezterm? I don’t have the .sh script you mentioned locally. Should I go through the document carefully so that I can delete the i_material.sh script?

saikete commented 1 year ago

@saikete

I think replacing characters manually is a lot of work, which is fine when there are few characters, but not a good solution when there are quite a lot of wrong characters

Maybe one of the helpers can be used?

Thank you very much for your suggestion, I will follow a more reasonable way to solve my problem, and at the end I will read the document carefully to complete the operation you said

wez commented 1 year ago

@saikete my comment was directed towards the nerd fonts maintainers, not to you specifically!

Finii commented 1 year ago

@wez

It would be great if you could consider removing i_material.sh if it is no longer an accurate mapping!

Well, it is used for the "removed" icons on the Cheat Sheet. Of course we could put it somewhere else, but...

I'd love it if there was a json blob or similar that held the definitive mapping in a machine readable structure!

Is https://github.com/ryanoasis/nerd-fonts/blob/master/glyphnames.json not suited? That is intended just for what you want to do.

It the moment the i_*.sh are 'the database' of the glyph names. Some of these shell scripts are autogenerated, some were manually tweaked. From that files all other collections of names come. For example the glyphnames file and the cheat sheet, as well as the css files. If that is a good solution? It is just how it grew historically. But I believe with the json file everyone can work? If we need an expansion in fields or something just tell me.

Finii commented 1 year ago

@wez

there is automation that scrapes the name -> symbol mapping from the various scripts

If you want to stick to that, I would suggest using (i.e. executing) the i_all.sh, as that will not return the removed icons (unless asked to). The information i_all.sh collects can then be automated further, see https://github.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/generate-css.sh as example.

But I guess glyphnames.json is even better for you.

Finii commented 1 year ago

@allcontributors add @loichyan for tool

allcontributors[bot] commented 1 year ago

@Finii

This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected string in JSON at position 35211

Finii commented 1 year ago

@allcontributors add @loichyan for tool

allcontributors[bot] commented 1 year ago

@Finii

I've put up a pull request to add @loichyan! :tada: