You are not logged in.

#1 2019-12-30 21:15:44

pwittchen
Member
From: Poland
Registered: 2019-07-02
Posts: 25
Website

urxvt cannot display unicode characters

Hi,

I wanted to switch from Gnome Terminal emulator to urxvt. Unfortnately, urxvt cannot display unicode characters and it displays empty squares instead of correct characters. I spent some time during searching for the solution on the web, but I could not find the proper answer. People say that there should be set some kind of fallback font in the config, but I have no idea, which one. Gnome terminal has set the same font like urxvt (Source Code Pro) and it's able to display all unicode characters properly.

Here's my `.Xresources` file:

! Cursor theme
xcursor.theme:            Vanilla-DMZ

! URxvt config

URxvt*termName:           rxvt-16color

URxvt.scrollBar:          off
URxvt.font:               xft: Source Code Pro:style=Regular:size=10,xft:DejaVu Sans:size=10
URxvt.internalBorder:     0
URxvt*selectToClipboard:  true
URxvt*saveLines:          10000

URxvt.perl-ext-common:    default,matcher,tabbedex,searchable-scrollback
URxvt.urlLauncher:        /usr/bin/brave
URxvt.matcher.button:     1
URxvt.tabbed.tabbar-fg:   8
URxvt.tabbed.tabbar-bg:   0
URxvt.tabbed.tab-fg:      2
URxvt.tabbed.tab-bg:      0
URxvt.tabbed.new-button:  no
URxvt.tabbed.title:       no
URxvt.imLocale:           pl_PL.UTF-8
URxvt.letterSpace:        0

! Tango color palette
URxvt*background:         #262626
URxvt*foreground:         #eeeeec
URxvt*cursorColor:        #8ae234
! foreground color for underline
URxvt*colorUL:            #8ae234
! line color for underline
URxvt*underlineColor:     #92659a
! black dark/light
URxvt*color0:             #2e3436
URxvt*color8:             #6e706b
! red dark/light
URxvt*color1:             #cc0000
URxvt*color9:             #ef2929
! green dark/light
URxvt*color2:             #4e9a06
URxvt*color10:            #8ae234
! yellow dark/light
URxvt*color3:             #edd400
URxvt*color11:            #fce94f
! blue dark/light
URxvt*color4:             #3465a4
URxvt*color12:            #729fcf
! magenta dark/light
URxvt*color5:             #92659a
URxvt*color13:            #c19fbe
! cyan dark/light
URxvt*color6:             #07c7ca
URxvt*color14:            #63e9e9
! white dark/light
URxvt*color7:             #d3d7cf
URxvt*color15:            #eeeeec

! xscreensaver
xscreensaver.fade:        false
xscreensaver.unfade:      false

! Disable ISO 14755 unicode input so we can use Ctrl-Shift bindings
URxvt.iso14755:        false
URxvt.iso14755_52:     false
!
! Disable Ctrl-Alt-c & Ctrl-Alt-v bindings (optional)
URxvt.keysym.C-M-c:    builtin-string:
URxvt.keysym.C-M-v:    builtin-string:
!
! Bind Ctrl-Shift-c & Ctrl-Shift-v to copy and paste
! I dont know why, but I needed to use hex keysym values to get it to work
URxvt.keysym.C-S-0x43: eval:selection_to_clipboard
URxvt.keysym.C-S-0x56: eval:paste_clipboard

Do you have any idea how to fix it?

Regards,
Piotr

Last edited by pwittchen (2019-12-30 21:16:43)

Offline

#2 2019-12-30 22:02:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: urxvt cannot display unicode characters

1. Don't force TERM.
2. Check your locale.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-12-30 22:07:03

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

Re: urxvt cannot display unicode characters

fc-match "Source Code Pro"
urxvt -fn "xft:Source Code Pro-10"

What specifically do you mean by "unicode characters" (example codepoint)?

Offline

#4 2019-12-30 22:19:41

pwittchen
Member
From: Poland
Registered: 2019-07-02
Posts: 25
Website

Re: urxvt cannot display unicode characters

For example, I have the following setup in my .tmux.conf file:

set -g status-right "#[fg=colour235]#[bg=colour235,fg=white] ⇅ #{cpu} ☰ #{ram} ↯ #{battery_level} #[fg=colour236]#[bg=colour236,fg=white] ↑ #{uptime} #[fg=colour235]#[bg=colour235,fg=white] ⧖ #(date '+%a, %b %d, %H:%M')"

and urxvt is not able to display special characters. It displays empty boxes instead. In Gnome Terminal it works fine.

Urxvt is not able to display other special characters and emoji as well.

Last edited by pwittchen (2019-12-30 22:20:48)

Offline

#5 2019-12-30 22:52:35

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

Re: urxvt cannot display unicode characters

"special characters" like "↯"?

Try

URxvt.font:               xft:Source Code Pro:style=Regular:size=10,xft:DejaVu Sans:size=8

(don't forget to reload the rdb!)

The glyph isn't in SCP and has to be resolved from DejaVu and the rather common prolem you're gonna run into here is that the DejaVu-10 glyph exceeds the monospace box defined by SCP-10 and urxvt will then just not render the glyph but a placeholder.

Offline

#6 2019-12-30 23:00:42

pwittchen
Member
From: Poland
Registered: 2019-07-02
Posts: 25
Website

Re: urxvt cannot display unicode characters

Yes, I meant characters like "↯" and others. Thanks for your suggestion, but it didn't work :-(. I reloaded config after update with: xrdb ~/.Xresources and started urxvt again, but result is the same.

Offline

#7 2019-12-30 23:04:37

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

Re: urxvt cannot display unicode characters

Try size=5 and work yourself up from there. Looking at the glyphs, you'll likely end up with 6 or 7.

Offline

#8 2019-12-30 23:07:15

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: urxvt cannot display unicode characters

Is there any particular reason you want to use rxvt-unicode? It's known to have very bad support for unicode (which is ironic, given its name). I'd recommend either sticking with gnome-terminal, or looking for another option from this long list of possibilities: https://wiki.archlinux.org/index.php/Li … _emulators


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#9 2019-12-30 23:11:04

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

Re: urxvt cannot display unicode characters

This is not a unicode issue at all. It's how urxvt resolves glyphs in substitute fonts.

Offline

#10 2019-12-30 23:14:26

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: urxvt cannot display unicode characters

Right, but urxvt is capable of not derping over the glyphs for ASCII text, I presume.

Font glyph rendering being broken on a conceptual level for anything more exciting than ASCII text is still an issue with the program's support for unicode, I would say... regardless of why the source code is that incorrectly developed.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#11 2019-12-30 23:24:19

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

Re: urxvt cannot display unicode characters

If your main font doesn't include the ASCII codepoints (yes, exists. some cjk fonts and oc. fucking emojis) urxvt will have "bad ASCII support".
The font configuration of urxvt is indeed "special" (because it essentially ignores fontconfig) but one might argue that it provides better control (once you figured the issues) and it's not like pango had no recent hiccups ;-)

The specific case will require you to resolve a non-monospace glyph and even if you're just cross-resolving different monospace fonts, the result is no longer monospaced (and often causes overlaps and other rendering issues in other terminals)
I'm not saying that one is better than the other, but I see where they're coming from (and, full disclosure: i tend to prefer that approach)

Offline

#12 2019-12-30 23:56:17

pwittchen
Member
From: Poland
Registered: 2019-07-02
Posts: 25
Website

Re: urxvt cannot display unicode characters

I tried to change size of the fallback font from 10 to 1 and it seems it's broken for all sizes.

@eschwartz: I wanted to experiment with new terminal emulators. I recently switched from Gnome DE to i3 WM and I wanted to have terminal emulator adjusted to this WM and I saw that several people on the web recommended using urxvt on i3. I also like the fact that configuration is kept in a single config file like i3 confg. Nevertheless, due to issues like the one described in this thread, I will probably keep using Gnome Terminal. It's not perfect, but I don't have any big issues with it.

Last edited by pwittchen (2019-12-30 23:57:22)

Offline

#13 2019-12-31 07:59:25

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

Re: urxvt cannot display unicode characters

Let's see the actual rdb entries as well as what the symbol resolves to on your system through fontconfig:

xrdb -q | grep -iE 'urxvt.*font'
FC_DEBUG=4 pango-view --font="Source Code Pro" -t ↯ | grep family:

Offline

#14 2019-12-31 12:51:35

pwittchen
Member
From: Poland
Registered: 2019-07-02
Posts: 25
Website

Re: urxvt cannot display unicode characters

Here's my output

URxvt.font:     xft: Source Code Pro:style=Regular:size=10,xft:DejaVu Sans:size=6

Second command printed out a lot of font names and then new window popped out with ↯ sign.

The last printed font was "Lucida Sans Unicode", so I wen to ~/.Xresources and changed fallback font to this one. Now ↯ sign is displayed correctly as well as few other signs, but still not all signs and emojis are displayed in this terminal emulator. I suppose it requires some kind of weird configuration of the chain of fallback fonts to make it work in the same way as Gnome Terminal.

Last edited by pwittchen (2019-12-31 12:52:24)

Offline

#15 2019-12-31 13:30:42

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

Re: urxvt cannot display unicode characters

Do you actually have dejavu installed?

 fc-match "DejaVu Sans"

Offline

#16 2019-12-31 13:44:22

pwittchen
Member
From: Poland
Registered: 2019-07-02
Posts: 25
Website

Re: urxvt cannot display unicode characters

It looked like I didn't have it installed. Right now, I installed it and I see the following output:

DejaVuSans.ttf: "DejaVu Sans" "Book

Now, all glyphs in my tmux status bar are displayed except for ⧖. Moreover, other glyphs and emojis are not displayed. It partially works.

Last edited by pwittchen (2019-12-31 13:45:39)

Offline

#17 2019-12-31 13:48:52

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

Re: urxvt cannot display unicode characters

DejaVu doesn't provide fuckingemojis, you'll have to install some fuckingemoji font like noto-fonts-emoji (and add that to the font list)
DejaVu doesn't provide U+29D6 either (and I don't know a font that does from the top of my hat)

Your list line sounds as if this was a result of installing dejavu? Or is a regression or an improvement?

Offline

#18 2019-12-31 13:51:09

pwittchen
Member
From: Poland
Registered: 2019-07-02
Posts: 25
Website

Re: urxvt cannot display unicode characters

It was a result of installing ttf-dejavu package via pacman. I'll check these other fonts later.

Offline

Board footer

Powered by FluxBB