nix-output-monitor icon indicating copy to clipboard operation
nix-output-monitor copied to clipboard

Missing/unsupported glyph(s), even with NerdFont?

Open x10an14 opened this issue 1 year ago • 15 comments

Hi!

I'm running nushell inside of tmux with this nerdfont installation (all installed through home-manager):

{pkgs, ...}: {
  fonts.fontconfig.enable = true;
  home.packages = [
    (pkgs.nerdfonts.override {
      fonts = ["Hasklig"];
    })
  ];
}

Yet, as below picture shows, there's one (or more) glyphs that don't render? (Please notice how all other glyps, including the ones from starship prompt do load/render).

If NerdFont doesn't support it, how/where else should we look for the glyphs nom intends to use? =S

Screenshot 1

Screenshot from 2023-07-11 23-54-50

Screenshot 2

Screenshot from 2023-07-11 23-58-21

EDIT: Above screenshots taken of gnome-terminal application running nushell inside (and outside) of tmux.

x10an14 avatar Jul 11 '23 22:07 x10an14

Seems related to (but not really same as) #80...

x10an14 avatar Jul 11 '23 22:07 x10an14

Hey there. Those emojis are a support nightmare. Maybe nom should bundle its font and its terminal.^^

The glyph in questions seems to be the "play" arrow. I am also using nerdfonts and that is actually one of the mor ecommon symbols so I have no clue why that problem is happening. Have you tried in a different terminal/without tmux maybe one of those break the encoding?

maralorn avatar Jul 12 '23 20:07 maralorn

Nushell w/o tmux

Screenshot from 2023-07-13 00-39-27 Screenshot from 2023-07-13 00-39-11

Bash w/o tmux

Screenshot from 2023-07-13 00-41-09 Screenshot from 2023-07-13 00-40-52

x10an14 avatar Jul 12 '23 22:07 x10an14

Yeah, I mean it was unlikely for nushell to be the problem.

Looking at your config a bit closer. Are you actually sure your terminal is using Hasklig NerdFont? At least the part of your config that you showed does not ensure that.

maralorn avatar Jul 13 '23 09:07 maralorn

Yeah, I mean it was unlikely for nushell to be the problem.

I honesly don't know enough about this to say whether it should or shouldn't =) I thought it pertinent to show with and without, due to always having to invoke nom through bash for the usecase of nix flake check on Nushell (complete & stderr/stdout, and combining stdout and stderr redirection).*

Looking at your config a bit closer. Are you actually sure your terminal is using Hasklig NerdFont? At least the part of your config that you showed does not ensure that.

Hmmm... How do I prove this (to you and me both) then? I tried googling "How to test nerdfonts works", but got nowhere... Found this though https://github.com/ryanoasis/nerd-fonts/discussions/829, which basically says this is impossible.

These(https://nix-community.github.io/home-manager/options.html#opt-fonts.fontconfig.enable) two(https://discourse.nixos.org/t/home-manager-nerdfonts/11226/2) sources are what I used to land on said configuration.


  • Maybe you'd want me to open up a separate github issue requesting support for nom flake check? Or maybe just nom flake?

x10an14 avatar Jul 13 '23 10:07 x10an14

I managed to install Kitty, instead of the default gnome-terminal terminal emulator available on Linux Mint.

Does this look correct?

Screenshot from 2023-07-13 13-33-25

Doesn't quite look like the "play" icons you referenced here:

The glyph in questions seems to be the "play" arrow.

x10an14 avatar Jul 13 '23 11:07 x10an14

Yeah, please make a new issue for nom flake.

Yeah, the emoji also looks wrong in kitty.

I generally look very closely at the letters maybe on a big fontsize and compare them with a picture of the font online. Normally you quickly see if the font is different.

maralorn avatar Jul 13 '23 12:07 maralorn

Would you agree this looks identical? I see that the => is not identical, but I think that might have something to do with the animation of characters combining into a new one... Screenshot from 2023-07-14 10-29-23

x10an14 avatar Jul 14 '23 14:07 x10an14

Yeah, ligature support (which you need for the nice implication symbol connected over two cells) in terminals is rare.

But actually I would say it is clear those two fonts are not the same: Compare e.g. the lower end of the large Q which is much more curved and longer in Hasklig. In general most letters in Hasklig look slightly more curved. Ah, now I see: the biggest difference is the small g. Definitely not the same font.

maralorn avatar Jul 15 '23 00:07 maralorn

Damn, you're correct. I apologize for my errant claim! Let's see if this thread is still relevant when I get it configured correctly.

x10an14 avatar Jul 15 '23 08:07 x10an14

I fixed it! NerdFont Hasklug is now used!

It was the terminal emulator (gnome-terminal) which didn't support ligatures, and used the wrong font.

The missing yellow icons are still missing... =/

However, with the below new home-manager nix config, I believe I am using the correct font.


Nix home-manager config leveraging nerdfont
{
  config,
  lib,
  pkgs,
  ...
}: let
  hasklugNerdFont = pkgs.nerdfonts.override {
    fonts = ["Hasklig"];
  };
in {
  fonts.fontconfig.enable = true;
  programs.kitty = lib.mkIf config.programs.kitty.enable {
    font = {
      package = hasklugNerdFont;
      name = "Hasklug Nerd Font Mono";
    };
  };
}

NB: Notice the profile comment of https://nix-community.github.io/home-manager/options.html#opt-programs.kitty.font.package!

Visual proof of Hasklug in use

Screenshot from 2023-07-16 17-30-17

x10an14 avatar Jul 16 '23 15:07 x10an14

Congrats! Enjoy the font!

But that didn’t fix the glyphs? That is weird and unsatisfying. I am kind of at a loss what else could be the culprit …

maralorn avatar Jul 16 '23 16:07 maralorn

Congrats! Enjoy the font!

Thank you! =)


But that didn’t fix the glyphs? That is weird and unsatisfying. I am kind of at a loss what else could be the culprit …

I tried again now with non-mono font version, no change =/

x10an14 avatar Jul 16 '23 21:07 x10an14

Adding the NerdFontsSymbolsOnly font to kitty +list-fonts didin't help either =/

x10an14 avatar Jul 16 '23 22:07 x10an14

I've also had some issues with this. The unicode character in question here, U+23F5 (⏵), is not part of NerdFonts as far as I can tell (same with the hourglass U+23F3). For me, installing Symbola using fonts.fonts = [pkgs.symbola]; in my system configuration to have a good fallback fonts for symbols like this that are neither part of standard fonts nor emoji nor part of NerdFonts fixed the problem.

Edit: see https://www.fileformat.info/info/unicode/char/23f5/fontsupport.htm for an incomplete list of fonts supporting the character in question. Symbola as my personal favourite font for this is listed as supporting U+23F5.

999eagle avatar Jul 23 '23 14:07 999eagle

I ran into this issue and installing the symbola font has resolved it.

Edit - Just read the comment above :facepalm:

flexiondotorg avatar Jun 19 '24 09:06 flexiondotorg

~The hourglass symbol is still missing for me (the one in orange I think?), even with symbola.otf listed in fc-list =/~

EDIT: Correction, ignore me. I went into the same trap again. It's not enough to start a new shell. I need to start a new terminal emulator for the changes to be picked up.

Many thanks to @999eagle for the find! And thanks to @flexiondotorg for the confirmation/kick in the rear to finally fix it =)

x10an14 avatar Jun 19 '24 11:06 x10an14

Also, nom does not use the hourglass symbol anymore. (Although I am not 100% sure that’s released, yet.)

maralorn avatar Jun 19 '24 11:06 maralorn