maralorn / nix-output-monitor

Pipe your nix-build output through the nix-output-monitor a.k.a nom to get additional information while building.
GNU Affero General Public License v3.0
895 stars 27 forks source link

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

Closed x10an14 closed 4 months ago

x10an14 commented 1 year ago

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](https://github.com/maralorn/nix-output-monitor/assets/710608/1798891d-35a7-4041-834f-ad6d03a4fb0a)
Screenshot 2 ![Screenshot from 2023-07-11 23-58-21](https://github.com/maralorn/nix-output-monitor/assets/710608/6a77e1fe-5529-4b98-b918-dbf100a8115a)

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

x10an14 commented 1 year ago

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

maralorn commented 1 year ago

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?

x10an14 commented 1 year ago
Nushell w/o tmux ![Screenshot from 2023-07-13 00-39-27](https://github.com/maralorn/nix-output-monitor/assets/710608/b6a53b4e-9baa-426e-a96a-b61bc1b06044) ![Screenshot from 2023-07-13 00-39-11](https://github.com/maralorn/nix-output-monitor/assets/710608/a0401440-b1b3-49a0-b8fb-e18e61d399eb)
Bash w/o tmux ![Screenshot from 2023-07-13 00-41-09](https://github.com/maralorn/nix-output-monitor/assets/710608/3de79b6d-c268-43d0-86df-37d3b79b3acb) ![Screenshot from 2023-07-13 00-40-52](https://github.com/maralorn/nix-output-monitor/assets/710608/bcb0df65-4220-4c5e-909d-a33c9ddc5d53)
maralorn commented 1 year ago

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.

x10an14 commented 1 year ago

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.


x10an14 commented 1 year ago

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](https://github.com/maralorn/nix-output-monitor/assets/710608/4158102e-48e0-46bd-bbe4-d544f9d34822)

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

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

maralorn commented 1 year ago

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.

x10an14 commented 1 year ago

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

maralorn commented 1 year ago

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.

x10an14 commented 1 year ago

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 commented 1 year ago

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 ```nix { 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](https://github.com/maralorn/nix-output-monitor/assets/710608/99d5187a-3a18-4a9d-8c3e-f8334d53af48)
maralorn commented 1 year ago

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 …

x10an14 commented 1 year ago

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 commented 1 year ago

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

999eagle commented 1 year ago

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.

flexiondotorg commented 4 months ago

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

Edit - Just read the comment above :facepalm:

x10an14 commented 4 months ago

~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 =)

maralorn commented 4 months ago

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