rainstormstudio / nerd-icons.el

GNU General Public License v3.0
206 stars 22 forks source link

nerd-icons-faicon doesn't work with `concat` in MS Windows Emacs #85

Open AnweshGangula opened 5 days ago

AnweshGangula commented 5 days ago

I'm using the below command to create a string with color-pallete icon which I want to use along with colorful-mode. But I'm not able to use the nerd-icons-faicon function with concat. It works fine with the insert function but not with concat.

I posted about this in colorful-mode as well - which you can find here more details.

But as mentioned in the issue mentioned above:

Problem

I can see that when I execute this command (C-c C-c) with insert I get the icon properly, but when I execute with concat the result is not rendered properly

using result

(insert (nerd-icons-faicon "nf-fae-palette_color") " ")

result command output

using concat

(concat (nerd-icons-faicon "nf-fae-palette_color") " ")

concat result

Additional details

I also asked for what the issue could be in this superuser post and found that the box that is currently being rendered with concat is in the Private Use Area. Does this mean this particular icon needs a specific font family?

seagle0128 commented 4 days ago

Interesting! If you use describe-char to check, you will find out no font specified on Windows, so the icons are unable to display correctly. Actually (insert (concat (nerd-icons-faicon "nf-fae-palette_color") " ")) will display the icons.

AnweshGangula commented 3 days ago

Yeah, this is working fine when I use insert, But I need to be able to se concat so that I can call (setq colorful-prefix-string (concat (nerd-icons-faicon "nf-fae-palette_color") " ")) in my init file to customize the colorful-mode face-attribute.

dr-scsi commented 6 hours ago

@AnweshGangula - Maybe I'm missing the point, but this is what I get on Windows: nerd

This is with Emacs 30.0.50 (cb67c34bcf) built with MSYS2/MinGW.

AnweshGangula commented 4 hours ago

@dr-scsi, yes it's working fine when I use insert, but if I use just cocat without insert in a codeblock and execute it, I don't see the icon (as mentioned this screenshot above