You are not logged in.

#1 2017-09-06 04:03:00

leggettc13
Member
Registered: 2017-04-25
Posts: 16

URxvt won't display some Unicode Characters properly

I've been trying to get URxvt to work properly with Unicode characters but no matter what I do it always displays every Unicode character as a rectangle. I've attempted to use Font Awesome, Wuncon Siji, DejaVu, Source Code Pro, Terminus, and none of them are displaying these characters properly, or at least URxvt isn't loading those fonts properly. Honestly I'm not sure exactly what is going on.

Currently my .Xresources file where the fonts for URxvt are defined looks like this

URxvt.font: xft:Source Code Pro Semibold:size=9,xft:DejaVu Sans Mono for Powerline:size=9,xft:FontAwesome:size=9

Does anyone know what could be going on here?

Last edited by leggettc13 (2017-09-06 13:26:57)

Offline

#2 2017-09-06 09:04:17

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: URxvt won't display some Unicode Characters properly

It works for me with the following font, at least for common unicode characters such as: é, œ, €, ... , with the following font:

urxvt -fn 'xft:DejaVu Sans Mono:size=9'

I would guess it is a locale problem. What's the output of the "locale" command? You should see utf8 in LC_CTYPE (for example en_US.utf8 or fr_FR.utf8). The locales are set with environment variables, see the wiki for more information.

Last edited by olive (2017-09-06 09:04:56)

Offline

#3 2017-09-06 11:31:39

leggettc13
Member
Registered: 2017-04-25
Posts: 16

Re: URxvt won't display some Unicode Characters properly

I didn't have anything set for LC_CTYPE initially but now that I do it hasn't solved my problem. I suppose I should clarify that common Unicode symbols are showing up just fine. Such as the degree symbol that shows up when I run screenfetch. The problem is in files like my polybar config file, where there are slightly fancier symbols that are nearly impossible to edit if I wanted to because they just show up as rectangles. I've tried adding in all the fonts that my polybar config file is using and while that has worked for polybar, it does not appear to have worked for URxvt.

Last edited by leggettc13 (2017-09-06 11:40:16)

Offline

#4 2017-09-06 12:18:06

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: URxvt won't display some Unicode Characters properly

displays every Unicode character as a rectangle

common Unicode symbols are showing up just fine

slightly fancier symbols

...

Which actual codepoints in particular?

Offline

#5 2017-09-06 13:09:56

leggettc13
Member
Registered: 2017-04-25
Posts: 16

Re: URxvt won't display some Unicode Characters properly

Things like the play and stop buttons used in the mpd module, the wifi symbol (dot with three curved lines in arcs above it), battery symbols, power button, those kinds of things. They show up in Polybar just fine, but they won't show up in urxvt when I open the config file with Vim. It's not the end of the world, I could always switch back to termite or terminator or something, but I'd like to get it to work if possible. Like I said I've tried combinations of all the fonts that my polybar is loading, but they still all show up as rectangles. Can URxvt just not render these?

Offline

#6 2017-09-06 13:37:10

seth
Member
Registered: 2012-09-03
Posts: 50,970

Offline

#7 2017-09-06 13:52:44

leggettc13
Member
Registered: 2017-04-25
Posts: 16

Re: URxvt won't display some Unicode Characters properly

Oh so do you mean like U+2023 which I think corresponds to the triangular bullet which I think polybar's mpd module uses as a play button? Sorry it's kinda hard to tell what's what when urxvt renders them all as rectangles.

Offline

#8 2017-09-06 14:35:31

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: URxvt won't display some Unicode Characters properly

u+2023 renders fine for me, using " xft:Source Code Pro" (and having that font installed, of course)

Offline

#9 2017-09-06 14:43:23

leggettc13
Member
Registered: 2017-04-25
Posts: 16

Re: URxvt won't display some Unicode Characters properly

Which is exactly why I'm confused as to why it won't render for me. I've even explicitly run the command

urxvt -fn xft:"Source Code Pro"

and it loads, using the correct font, but those characters still don't render

Offline

#10 2017-09-06 14:59:28

leggettc13
Member
Registered: 2017-04-25
Posts: 16

Re: URxvt won't display some Unicode Characters properly

As a side note, when I try to use urxvt with certain other fonts using the -fn argument, I get something like this

urxvt -fn xft:FontAwesome
urxvt: unable to calculate font width for 'FontAwesome:minspace=True', ignoring.
urxvt: unable to load base fontset, please specify a valid one using -fn, aborting.

Offline

#11 2017-09-06 15:34:38

leggettc13
Member
Registered: 2017-04-25
Posts: 16

Re: URxvt won't display some Unicode Characters properly

Another interesting thing I have noticed is that Termite renders these characters, but they are not the same characters that show up in Polybar. For example, what looks like a play button on polybar looks like some latin character in termite. I can change termite's font to use Wuncon Siji and it will then render those characters properly, but then the spacing is all off.

Offline

#12 2017-09-06 15:58:39

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

Re: URxvt won't display some Unicode Characters properly

Learn to use the edit button, and stop bumping the thread.

Post your full .Xresources.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2017-09-06 16:05:58

leggettc13
Member
Registered: 2017-04-25
Posts: 16

Re: URxvt won't display some Unicode Characters properly

Ok. I haven't done a lot with it besides the font but here it is

URxvt.font: xft:DejaVu Sans Mono for Powerline:size=9,xft:Unifont:size=9,xft:WunconSiji:size=9,xft:FontAwesome:size=9
URxvt.boldFont: xft:Source Code Pro Semibold:size=9,xft:DejaVu Sans Mono for Powerline:size=9,xft:FontAwesome:size=9
URxvt.depth: 32
URxvt.background: rgba:0000/0000/0200/c800
URxvt.foreground: White
URxvt.letterspace: 0
URxvt.scrollBar: false

Offline

#14 2017-09-06 18:02:52

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: URxvt won't display some Unicode Characters properly

Ah, blast. u+2023 is resolved from "DejaVu Sans", it's not in "Source Code Pro" itself.

fc-match -s "Source Code Pro"
FC_DEBUG=4 pango-view --font="Source Code Pro" -t ‣ | grep 'family:'

(or any other font you intend to use)

Offline

#15 2017-09-06 18:53:57

leggettc13
Member
Registered: 2017-04-25
Posts: 16

Re: URxvt won't display some Unicode Characters properly

I think I'm starting to see the problem here and I'm not sure if it's something I can fix. What I'm gathering from some other experimenting I've been doing is that Wuncon Siji, the font that polybar is using to display symbols, uses different symbols for the same codepoints as other fonts. If I use the command in the comment above, but substitute Wuncon Siji, it shows me a different character than with any other fonts. So basically, even if I can get it to display the right characters for this situation, it may be the wrong characters for others. For example, the "play button" that polybar uses via Wuncon Siji font shows up as a different symbol in other fonts. I'm having trouble finding the codepoint, but it looks kinda like a T, except the bar on top is curved.
EDIT: It might be u+1E60

That being said, URxvt is still not properly displaying it, which is still a problem. It doesn't display it properly whether I use DejaVu, Source Code Pro, Fira Mono Code, or any other font I've tried, I'm starting to think I need to go back to Termite or something.

EDIT: I got it to properly show the characters for the Wuncon Siji font, so hopefully this doesn't cause any more problems in the future.

Last edited by leggettc13 (2017-09-06 19:27:02)

Offline

#16 2017-09-06 19:54:19

seth
Member
Registered: 2012-09-03
Posts: 50,970

Re: URxvt won't display some Unicode Characters properly

urxvt -fn "xft:Source Code Pro,xft:Wuncon Siji"

would be the correct approach but runs into

urxvt: unable to calculate font width for 'Wuncon Siji:slant=0:weight=100:pixelsize=18:minspace=True', ignoring

Try to remove

URxvt.letterspace: 0

from your resources.

Offline

#17 2017-09-07 15:03:18

leggettc13
Member
Registered: 2017-04-25
Posts: 16

Re: URxvt won't display some Unicode Characters properly

I managed to get it displaying the characters correctly by reinstalling the Siji font directly from github and then specifying it in my Xresources the "old-fashioned way" instead of the xft way. I do not know why I couldn't get it to work correctly when installing it via the package manager, but for now I am considering this fixed. Thank you all for your help.

Offline

Board footer

Powered by FluxBB