maralorn / nix-output-monitor

Pipe your nix-build output through the nix-output-monitor a.k.a nom to get additional information while building.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

x10an14 opened this issue · 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.

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

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?

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

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.

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 ryanoasis/nerd-fonts#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?

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.

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.

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

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.

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.

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

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 …

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 =/

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

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.