rxvt-unicode and the Powerline symbols

Marc Lehmann schmorp at schmorp.de
Sat Jan 9 17:37:05 CET 2016


tl;dr: your font is not a fixed-width font, which is needed for terminal
usage.

On Sat, Jan 09, 2016 at 04:04:50AM +0300, "Rakulenko A." <me at rakul.info> wrote:
> I run gentoo and i try to stay to the stable tree as long as it doesn't
> I also downloaded rxvt-unicode sources and made a fresh build without
> using gentoo portage system, just to check - it doesn't matter.

first of all, the gentoo package of urxvt comes with custom patches that
are known to be buggy and _directly affect your problem_ by altering font
widths, so it's best to use an official release, or use a gentoo-specific
support forum, when you use the gentoo package.

however, what you describe is a relatively common issue:

> Kopete in parallel to urxvt in the middle of my struggle:
> (http://i6.5cm.ru/i/CRD5.png).
> As you can foresee, Kopete displays everything perfectly, and so it does
> now (not actually now, but it would if i run it).

Looking at that, it seems that the U+2699 char is somehow between "-"
and "s" in the line above it, and that hints at the basic problem: you
need a fixed-width font (or, specifically, a cell-space font), but got a
proportional font instead.

terminals use a grid system, for example, 80x24 cells. in urxvt,
characters can be one or two cells wide (as per your locale), and all
the characters you are writing about are one cell wide in your locale.
however, looking at the above screenshot, it's quite clear that these
characters are too wide.

unfortunately, while x11 core fonts support this,
xft/fontconfig/freetype/etc. have more or less completely removed support
for internationalised terminal fonts, and there is effectively no support
for fixed-width or monospace fonts either: monospace, in xft, typically
means that ascii characters are fixed-width, and maybe some other letters,
but that's it. xft has no support for locales either, which is partially
mitigates by the fact that many fonts follow the unicode widths, and most
operating systems have compatible widths when using a utf-8 locale.

urxvt can cope with slightly wider characters up to a point, but it looks
as if some of your characters are simply too wide to fit. urxvt also does
a few guesses to see if a font has compatible widths, but it cannot check
all characters of a font (that would be way too slow), and to make things
worse, xft often delivers wrong font metrics before a character has been
rendered (i.e. when rendering a character it might suddenly be a pixel
wider than the font metrics originally claimed. since this is only detected
at rendering time, it is too late for urxvt to reconsider the font.

what you would need is a monospace fopnt where these characters really
are as wide as the letter characters (or double-wide, depending on your
locale). failing that, you can also experiment by simply chosing a smaller
font size for your powerline font, or maybe synthesizing a condensed
version of it using a transformation matrix.

> 
> I tried specifying font to urxvt using the command line parameter, from
> ~/.Xresourses and ~/.Xdefaults files, and using the magic term-sequesnce.
> I found out that urxvt is very reliable when it comes to using it's
> various features.
> 
> I tried building urxvt with all sane USE-flag combination.
> 
> So, if anybody knows how to fix that - please help.
> Meanwhile will try debugging~
> 

> _______________________________________________
> rxvt-unicode mailing list
> rxvt-unicode at lists.schmorp.de
> http://lists.schmorp.de/mailman/listinfo/rxvt-unicode


-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the rxvt-unicode mailing list