powerline / fonts

Patched fonts for Powerline users.
25.59k stars 3.2k forks source link

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

Open css459 opened 8 years ago

css459 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

n2i commented 8 years ago

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. https://github.com/powerline/powerline/issues/684

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

andrew-nowak commented 8 years ago

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 commented 7 years ago

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

tomibennett commented 7 years ago

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

mrmowgli commented 7 years ago

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 commented 7 years ago

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

akatrevorjay commented 7 years ago

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

akatrevorjay commented 7 years ago

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

akatrevorjay commented 7 years ago

More info: https://github.com/powerman/wcwidth-icons

tnguyen14 commented 6 years ago

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

thulester commented 6 years ago

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?

step- commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

thanks, it work for me

sdh0618 commented 5 years ago

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 commented 5 years ago

@sdh0618 that looks like qutebrowser

tsoernes commented 5 years ago

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 commented 5 years ago

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 commented 3 years ago

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