nix-output-monitor
nix-output-monitor copied to clipboard
urxvt rendering issues with chosen emoji
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;
⌛ 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
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:
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).
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.