You are not logged in.

#1 2019-03-23 05:38:41

dxxvi
Member
Registered: 2011-07-23
Posts: 126

Unable to display a lot of unicode characters in urxvt

I read a lot of other questions about urxvt and unicode in this forum but didn't see any applicable for my case.
This is all the configurations on my machine related to urxvt and unicode that I can think of:

  • I'm using urxvt-tabbedex-mina86-git

  • $ locale
    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    $ locale -a
    C
    en_US.utf8
    POSIX
    $ fc-match mono
    NotoSansMono-Light.ttf: "Noto Sans Mono" "Light"
    $ fc-match monospace
    NotoSansMono-Light.ttf: "Noto Sans Mono" "Light"
    $ fc-match sans
    NotoSans-Regular.ttf: "Noto Sans" "Regular"
    $ fc-match sans-serif
    NotoSans-Regular.ttf: "Noto Sans" "Regular"
    $ fc-match serif
    NotoSerif-Regular.ttf: "Noto Serif" "Regular"
    $ fc-match "Noto Sans Mono Light"
    NotoSansMono-Light.ttf: "Noto Sans Mono" "Light"
    $ cat ~/.Xresources 
    Xft.dpi: 144
    Xft.autohint: 0
    Xft.lcdfilter:  lcddefault
    Xft.hintstyle:  hintfull
    Xft.hinting: 1
    Xft.antialias: 1
    Xft.rgba: rgb
    URxvt.font: xft:Noto Sans Mono:Light:pixelsize=32
    I don't have URxvt.letterSpace in ~/.Xresources
    $ echo -e "\U2345 \U2346 \U2615 \U2614 \U2613 \U2612 \U265C"
    ⍅ ⍆ ☕ ☔ ☓ ☒ ♜

    Note: The echo command above only printed the first 2 unicode characters correcly, it printed boxes for all the rest, but when I copied from urxvt to firefox, it showed all the unicode characters.

  • $ cat $XDG_CONFIG_HOME/fontconfig/fonts.conf 
    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
      <alias>
        <family>sans-serif</family>
        <prefer>
          <family>Noto Sans</family>
          <family>Font Awesome 5 Brands</family>
          <family>Font Awesome 5 Free</family>
        </prefer>
      </alias>
      <alias>
        <family>sans</family>
        <prefer>
          <family>Noto Sans</family>
          <family>Font Awesome 5 Brands</family>
          <family>Font Awesome 5 Free</family>
        </prefer>
      </alias>
      <alias>
        <family>serif</family>
        <prefer>
          <family>Noto Serif</family>
        </prefer>
      </alias>
      <alias>
        <family>mono</family>
        <prefer>
          <family>Noto Sans Mono Light</family>
        </prefer>
      </alias>
      <alias>
        <family>monospace</family>
        <prefer>
          <family>Noto Sans Mono Light</family>
        </prefer>
      </alias>
    </fontconfig>
  • I load the ~/.Xresources  at the end of ~/.bashrc with

    if [[ $DISPLAY ]]; then
        xrdb ~/.Xresources
    fi
  • I'm pretty sure that Noto Sans Mono Light has icons for these characters: \U2615 \U2614 \U2613 \U2612 \U265C: I put this in an html file and firefox can show the unicode characters correclty:

    <p style="font-family: 'Noto Sans Mono Light'">&#x2615; &#x2614; &#x2613; &#x2612; &#x265c;</p>

Does anybody know what the problem is?

Last edited by dxxvi (2019-03-23 05:39:50)

Offline

#2 2019-03-23 09:14:46

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,574

Re: Unable to display a lot of unicode characters in urxvt

Checked and at least #2615 is NOT in Noto Sans Mono Light, so it's resolved from somewhere else

FC_DEBUG=4 pango-view --font="Noto Sans Mono Light" -t ☕ | grep family:

(DejaVu Sans for me, but I don't have Noto installed)

You've to add that font to urxvt's font config. A common trap is that urxvt won't print glyphs that exceed the general box, so you might have to use it in a smaller variant, eg.

URxvt.font: xft:Noto Sans Mono:Light:pixelsize=32,xft:DejaVu Sans:size=pixelsize=28

Offline

Board footer

Powered by FluxBB