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

urxvt rendering issues with chosen emoji

Open anund opened this issue 2 years ago • 4 comments

urxvt has ~poor support for emoji. Nom has picked some emoji I'm not sure it can support anytime soon. Considering the existing set may be be better outside the context of urxvt here is some documentation to help others with the issue. (issue is purely informational)

Reproducing: Agreeing on a version of urxvt nix-shell -p rxvt-unicode-unwrapped Agreeing on a font configuration urxvt -fn "xft:DejaVu Sans Mono:size=14,xft:Unifont:Style=Regular:antialias=false" Printing the characters of interest echo "⏵ ✔ ⏳ ⚠ ↓ ↑ ✔ ∅ ⏱ ∑"

Debugging: Printing the hex code of characters that don't render in the launched urxvt printf "%x %x %x" \'⏵ \'⏳ \'⏱ (the hourglass just renders poorly with this font choice) Getting a list of fonts that support these characters fc-list ":charset=23f5 23f3 23f1" (Unifont claims too)

Finding some alternatives ▸ ⌛ ⌚ (25b8 231b 231a). The arrow has the most possibility for alternatives. The hourglass is the a lower code point usually missing falling sand. It renders pooly in Unifont but does have nicer versions in other fonts. The clock is a lower code point that happens to be a watch. It prints poorly in Unifont but does have nicer versions in others that look like a clock rather than a watch.

  nixpkgs.overlays = [
    (self: super: {
      nix-output-monitor = super.nix-output-monitor.overrideAttrs( oldAttrs: {
        patches = [ ./nom.patch ];
      });
    })
  ];
diff --git a/lib/NOM/Print.hs b/lib/NOM/Print.hs
index c48e2a7..aa32700 100644
--- a/lib/NOM/Print.hs
+++ b/lib/NOM/Print.hs
@@ -78,16 +78,16 @@ down = "↓"
 up = "↑"
 
 -- | U+23F1 STOPWATCH
-clock = "⏱"
+clock = "⌚"
 
 -- | U+23F5 BLACK MEDIUM RIGHT-POINTING TRIANGLE
-running = "⏵"
+running = "▸"
 
 -- | U+2714 HEAVY CHECK MARK
 done = "✔"
 
 -- | U+23F8 DOUBLE VERTICAL BAR
-todo = "⏸"
+todo = "⌛"
 
 -- | U+26A0 WARNING SIGN
 warning = "⚠"

Font fishing package list.

  fonts.fonts = with pkgs; [ 
    arphic-ukai
    arphic-uming
    corefonts
    crimson
    dejavu_fonts 
    font-awesome
    freefont_ttf 
    inconsolata
    inter
    joypixels
    liberation_ttf
    manrope
    montserrat
    nerdfonts
    noto-fonts
    noto-fonts-cjk
    noto-fonts-emoji
    noto-fonts-extra
    openmoji-color
    powerline-fonts
    roboto
    roboto-mono
    source-han-sans-japanese
    source-han-sans-korean
    source-han-sans-simplified-chinese
    source-han-sans-traditional-chinese
    source-sans-pro
    symbola
    ttf_bitstream_vera
    twitter-color-emoji
    ubuntu_font_family
    unifont 
    wqy_microhei
    wqy_zenhei
  ];
  nixpkgs.config.joypixels.acceptLicense = true;

anund avatar Dec 28 '22 11:12 anund

⌛ is bad, because it has a different meaning!

A classic hourglass, all of its sand having flowed into the bottom bulb. Indicates time has passed.

⏳ stands for:

A classic hourglass, its sand still flowing from the top to bottom bulb. Indicates time is still passing

which perfectly fit's the waiting here

davidak avatar Feb 18 '23 01:02 davidak

One renders an hourglass emoji correctly in the specific mentioned terminal in most fonts the other does not. It's a trade off and not an actual patch suggestion. If you're using the above combinations of things this lets things render nicely. :shrug:

anund avatar Feb 18 '23 10:02 anund

Yeah, it’s a bit sad, that the other hourglass seems to have better support. This is hard to get right. I will have a look into this, once I pick up development again (in about two months).

maralorn avatar Feb 18 '23 10:02 maralorn

For the record, there is a rxvt-unicode-emoji package variant in nixpkgs, which includes patches that seem to fix this issue. The left side of clips a bit, but otherwise it looks fine. 2023-12-08-015017_275x50_scrot

tejing1 avatar Dec 08 '23 06:12 tejing1