Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some unicode symbols still not displayed with urxvt or xterm #176

Open
css459 opened this issue Jun 1, 2016 · 27 comments
Open

Some unicode symbols still not displayed with urxvt or xterm #176

css459 opened this issue Jun 1, 2016 · 27 comments

Comments

@css459
Copy link

css459 commented Jun 1, 2016

I've been having trouble viewing certain unicode symbols under urxvt or xterm. The font I'm using is Source Code Pro for Powerline which I installed through the powerline fonts repo. My .Xresources contains the following:

  9 URxvt.font: xft:Source\ Code\ Pro\ for\ Powerline:pixelsize=22,xft:PowerlineSymbols
 10 URxvt.scrollBar: false
 11 
 12 Xft.dpi: 150
 13 Xft.antialias: true
 14 Xft.rgba: rgb
 15 Xft.hinting: true
 16 Xft.hintstyle: hintslight
 17 
 18 XTerm*selectToClipboard: true
 19 XTerm*termName: xterm-256color
 20 XTerm*locale: true
 21 XTerm*metaSendsEscape: true
 22 UXTerm*faceName: Source Code Pro for Powerline:style=Medium
 23 UXTerm*faceSize:10

but I still get funky behavior like in the following circumstances

1
2
3

$TERM outputs rxvt-unicode-256color

Running urxvt --help 2>&1 | grep options: returns iso14755, unicode3, and frills among other things.

I've also made sure that my locale and LANG are indeed set to en_US-UTF-8
Output of locale -a
C
en_US.utf8
POSIX

So I'm unsure why I still can't see some of these unicode symbols because I have all my bases covered? This is happening system-wide as I can't see certain symbols in Firefox either, so I think it has to be a font issue.

@n2i
Copy link

n2i commented Jun 27, 2016

Hi,

Have you tried it in GVIM or another term such as lxterminal?

I've got the same problem with both urxvt and xterm, and with termNames: xterm, xterm-256color and so on.

Then I tried the same font on GVIM and lxterminal, both just worked fine, so I think the problem is not a font's issue. It's must be a term features/settings issue.

I cannot figure out why till now. Waiting for help.

@css459
Copy link
Author

css459 commented Jun 27, 2016

All works well on MacVIM but GVIM under linux gives a similar behavior, so I suppose this is system oriented.

@n2i
Copy link

n2i commented Jul 3, 2016

With GVIM, you specific the font by set guifont=, have you try this yet?

The following thread gives informations that help to get urxvt works with powerline fonts.
powerline/powerline#684

I got urxvt displays powerline symbols well now, but no luck with Awesome fonts, nerd-fonts.

@andrew-nowak
Copy link

So I had this issue in urxvt and it took me a stupidly long time to find that (for me) this was caused by the characters being too closely spaced.
In my .Xresources, I had
URxvt.letterSpace: 0 which caused some symbols not to be displayed
I changed this to URxvt.letterSpace: 1 and the symbols were displayed.

I'm not sure that this solves the above problem, as gvim did always show the missing symbols, but hopefully helps anyone who has read through the issues and is still stuck with symbols not displaying.

@gipert
Copy link

gipert commented Oct 19, 2016

Even after trying to change the letterSpace instruction I still get the same problem... Any other hint?

@tomibennett
Copy link

Same problem over here. I tried in Terminator however and it was fine except for some spacing issue.

@mrmowgli
Copy link

Ok, so, after digging around for a while I found out that the real issue (on some urxvt installs) is that on really lean builds not all options are actually compiled into urxvt. In other words see this:

http://powerline.readthedocs.io/en/master/troubleshooting.html#urxvt-unicode3-and-frills

@akatrevorjay
Copy link

For URxvt to show glyphs, you must use the single width variants (they end in Mono

@akatrevorjay
Copy link

Without those, only the single-width fitting glyphs will show

@akatrevorjay
Copy link

(unless you up URxvt.letterSpace that is, but then everything looks all hokey)

@akatrevorjay
Copy link

@tnguyen14
Copy link

I've tried adding letterSpace, but certain character, such as "" still doesn't display for me..

@thulester
Copy link

Your .Xresources file has prefixes of the form:
XTerm* and
UXTerm*

But echo $TERM suggests you're using another terminal:
$TERM outputs rxvt-unicode-256color

I'm running rxvt-unicode-256color and my prefixes are of the form:
URxvt*

Just guessing here but I'm thinking XTerm works for xterm and URxvt works for rxvt-unicode-256color?

gorillamoe added a commit to gorillamoe/dotfiles that referenced this issue Jan 8, 2018
@step-
Copy link

step- commented Feb 11, 2018

urxvt -letsp 0 worked for me, so I added URxvt.letterSpace: 0 to my ~/.Xresources file.
It's zero explicitly. Don't rely on the internal default initialization of letterSpace, which in my system is evidently broken. If zero isn't enough, try letterSpace 1, which makes the terminal even wider.

@tynrare
Copy link

tynrare commented Mar 4, 2018

Oh god finnaly i fixed it.

All was because two things:

  1. Fallback problem (not really big)
  2. minspace problem (too good hidden)

My config .Xresources:
URxvt.font: xft:DejaVu Sans:pixelsize=14,xft:Symbola,xft:Noto Emoji:minspace=False
Or you can test it by command
urxvt -fn 'xft:DejaVu Sans:pixelsize=14,xft:Symbola,xft:Noto Emoji:minspace=False'

  1. I had to use pack of fonts for unicode and emodji as fallback fonts. It fixed some of missing symbols, but not all
  2. Here's hard trick. urxvt can't draw one symbol on another. What you have to do to make all symbols work:
    2.1. Don't use Mono fonts. OR use letterSpace: 3+
    2.2. Add minspace=False if you still want use Mono (And just for case anyway). It will help a little but you will still need biger letterSpace

So problem i see - we have to expand letter-space somehow or scale down symbols that too big. Or fing good non-mono font. Actually without monospace font big symbols scaling down, but @ W M scales down too and it looks ugly. Anyone know how to allow some symbols be greater than another?

p.s. I see urxvt-font-size packet in aur, maybe it might help
p.p.s. Sooo i just moved to sakura terminal. It's pure urxvt problem that i can't fix

@blockloop
Copy link

I actually fixed the font problem by following doronbehar's fix posted here

ln -s ~/.local/share/fonts ~/.fonts

None of the other fixes worked for me. letterSpace looks terrible with anything but -1 for me.

@stevanmilic
Copy link

stevanmilic commented Apr 17, 2018

I fixed it following solution from @Tymonrare.

My .Xresource file before:

URxvt*font:                 xft:Inconsolata Nerd Font Mono:pixelsize=27
URxvt*boldFont:             xft:Inconsolata Nerd Font Mono:pixelsize=27
URxvt*letterSpace: 0

My .Xresource file after fix:

URxvt*font:                 xft:Inconsolata Nerd Font Mono:pixelsize=27:minspace=False, xft:DejaVu Sans:pixelsize=18
URxvt*boldFont:             xft:Inconsolata Nerd Font Mono:pixelsize=27:minspace=False, xft:DejaVu Sans:pixelsize=18
URxvt*letterSpace: 0

As you can see I only added xft:DejaVu Sans:pixelsize=18 as my second font, and it was working good after that, although some fonts are still not showing up.

Hope that helps someone!

@flamendless
Copy link

Woah, thanks @stevanmilic
Im using rxvt-unicode-patched on arch linux.
Ive set mine into
URxvt*font: xft:Inconsolata Nerd Font Mono:size=15, xft:DejaVu Sans:size=12
playing around with the values makes the icon fonts to be displayed

@dlmiyamoto
Copy link

Recently dealt with this problem as a Fedora user and thought I'd chime in. I noted this bug report
. Powerline glyphs did not work on urxvt and urxvt256c, worked with urxvt256c-ml.

@johnchandlerburnham
Copy link

johnchandlerburnham commented Sep 23, 2018

Based on @stevanmilic's solution, I added the following to my .Xresources:

#define font1         Inconsolata LGC
#define font2         Inconsolata Nerd Font
#define font3         DejaVu Sans Mono Nerd Font
#define font4         Noto Sans Mono CJK JP

URxvt*letterSpace: 0
URxvt*font:           xft:font1:pixelsize=16, xft:font2:pixelsize=14:minspace=false, xft:font3:pixelsize=14,xft:font4:pixelsize=14
URxvt*boldFont:       xft:font1:bold:pixelsize=16, xft:font2:pixelsize=14:minspace=False,xft:font3:pixelsize=14,xft:font4:pixelsize=14
URxvt*italicFont:     xft:font1:italic:pixelsize=16, xft:font2:pixelsize=14:minspace=False,xft:font3:pixelsize=14,xft:font4:pixelsize=14
URxvt*boldItalicFont: xft:font1:bold:italic:pixelsize=16, xft:font2:pixelsize=14:minspace=False, xft:font3:pixelsize=14, xft:font4:pixelsize=14

This has very good Unicode symbol coverage, which you can see in this screenshot:
selection_005

@patillacode
Copy link

URxvtfont: xft:Inconsolata Nerd Font Mono:pixelsize=27:minspace=False, xft:DejaVu Sans:pixelsize=18 URxvtboldFont: xft:Inconsolata Nerd Font Mono:pixelsize=27:minspace=False, xft:DejaVu Sans:pixelsize=18 URxvt*letterSpace: 0

This was the final solution. Thanks

@denandaprayoga
Copy link

URxvt*font: xft:Inconsolata Nerd Font Mono:pixelsize=27:minspace=False, xft:DejaVu Sans:pixelsize=18

thanks, it work for me

@sdh0618
Copy link

sdh0618 commented Feb 21, 2019

Based on @stevanmilic's solution, I added the following to my .Xresources:

#define font1         Inconsolata LGC
#define font2         Inconsolata Nerd Font
#define font3         DejaVu Sans Mono Nerd Font
#define font4         Noto Sans Mono CJK JP

URxvt*letterSpace: 0
URxvt*font:           xft:font1:pixelsize=16, xft:font2:pixelsize=14:minspace=false, xft:font3:pixelsize=14,xft:font4:pixelsize=14
URxvt*boldFont:       xft:font1:bold:pixelsize=16, xft:font2:pixelsize=14:minspace=False,xft:font3:pixelsize=14,xft:font4:pixelsize=14
URxvt*italicFont:     xft:font1:italic:pixelsize=16, xft:font2:pixelsize=14:minspace=False,xft:font3:pixelsize=14,xft:font4:pixelsize=14
URxvt*boldItalicFont: xft:font1:bold:italic:pixelsize=16, xft:font2:pixelsize=14:minspace=False, xft:font3:pixelsize=14, xft:font4:pixelsize=14

This has very good Unicode symbol coverage, which you can see in this screenshot:
selection_005

What's the browser you are using?

@craftyguy
Copy link

@sdh0618 that looks like qutebrowser

@tsoernes
Copy link

tsoernes commented Mar 21, 2019

I'm still struggling with a couple of symbols.
I got:

URxvt.font: xft:Liberation Mono for Powerline:antialias=true:hinting=true:pixelsize=22:minspace=false, xft:DejaVu Sans:pixelsize=22
URxvt.boldFont:  xft:Liberation Mono for Powerline:antialias=true:hinting=true:pixelsize=22:weight=bold, xft:DejaVu Sans:pixelsize=22:weight=bold

URxvt.xftAntialias:     true
URxvt.xftHinting:	true
URxvt.letterSpace: -1

Xft.dpi:                    96
Xft.antialias:              true
Xft.rgba:                   rgb
Xft.hinting:                true
Xft.hintstyle:              hintsmedium

And,

$ urxvt256c-ml --help 2>&1 | grep options:
options: perl,xft,styles,combining,blink,iso14755,unicode3,encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext,fade,transparent,tint,pixbuf,XIM,frills,selectionscrolling,wheel,slipwheel,smart-resize,cursorBlink,pointerBlank,scrollbars=plain+rxvt+NeXT+xterm

But this symbol does not display:

(Have tried with letterSpace 0 and 1)

For some reason, starting urxvt from terminal yields the message
urxvt: unable to calculate font width for 'Courier New:slant=0:weight=100:pixelsize=26:antialias=False:autohint=True:minspace=True', ignoring.
Even though there's no reference to Courier anywhere in the config file and my system does not have Courier New installed at all.

@LinusLaber
Copy link

In my case the font works fine in xterm

but doesn't with urxvt

URxvt.font: xft: Source Code Pro for Powerline:style=Regular:size=11

XTerm.vt100.faceName: Source Code Pro for Powerline:style=Regular:size=11

And letterspacing , minspace=False, checking compile flags and urxvt256c-ml all didn't help.

@natanhp
Copy link

natanhp commented Mar 3, 2021

I fixed it following solution from @Tymonrare.

My .Xresource file before:

URxvt*font:                 xft:Inconsolata Nerd Font Mono:pixelsize=27
URxvt*boldFont:             xft:Inconsolata Nerd Font Mono:pixelsize=27
URxvt*letterSpace: 0

My .Xresource file after fix:

URxvt*font:                 xft:Inconsolata Nerd Font Mono:pixelsize=27:minspace=False, xft:DejaVu Sans:pixelsize=18
URxvt*boldFont:             xft:Inconsolata Nerd Font Mono:pixelsize=27:minspace=False, xft:DejaVu Sans:pixelsize=18
URxvt*letterSpace: 0

As you can see I only added xft:DejaVu Sans:pixelsize=18 as my second font, and it was working good after that, although some fonts are still not showing up.

Hope that helps someone!
This answer works, thankyou. However, I did some modification to make it look nicer in my terminal:

URxvt*font:                 xft:Fira Code Retina:pixelsize=11:minspace=False, xft:DejaVu Sans:pixelsize=8
URxvt*boldFont:             xft:Fira Code Retina:pixelsize=11:minspace=False, xft:DejaVu Sans:pixelsize=8

But still it won't display this box icon (📦), still searching for the perfect solution.

UPDATE

I can display 📦 as well as ⌚ and maybe any other emoji using Symbola font

URxvt*font:                 xft:Fira Code Retina:pixelsize=11:minspace=False, xft:DejaVu Sans:pixelsize=8, xft: Symbola
URxvt*boldFont:             xft:Fira Code Retina:pixelsize=11:minspace=False, xft:DejaVu Sans:pixelsize=8, xft: Symbola

ramacassis pushed a commit to ramacassis/confighamac that referenced this issue Apr 8, 2021
- fonts with 'Mono' suffix are needed to fix glyphs display
- see issue: powerline/fonts#176 (comment)
- more info about 'Mono' variant: https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hack/readme.md
ramacassis added a commit to ramacassis/confighamac that referenced this issue Sep 27, 2021
- fonts with 'Mono' suffix are needed to fix glyphs display
- see issue: powerline/fonts#176 (comment)
- more info about 'Mono' variant: https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hack/readme.md
ramacassis added a commit to ramacassis/confighamac that referenced this issue Oct 9, 2021
- fonts with 'Mono' suffix are needed to fix glyphs display
- see issue: powerline/fonts#176 (comment)
- more info about 'Mono' variant: https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hack/readme.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests