You are not logged in.

#1 2008-09-22 19:07:36

dwahler
Member
Registered: 2008-09-09
Posts: 1

urxvt font widths

I'm using urxvt with with the font set to DejaVu Sans Mono-8. Everything works great except that there's tons of extra horizontal space between characters. The same problem shows up when I use certain other fonts, like Consolas. I took screenshots to compare the output, and urxvt is rendering the same string of text at about 115% the width of other applications like gedit (but the same height). Here's a shot showing the difference:

qsmp.png

My .Xresources looks like this:

urxvt.scrollBar: false
urxvt.font: xft:DejaVu Sans Mono-8
urxvt.xftAutoHint: true

Xft.dpi: 96
Xft.antialias: 1
Xft.rgba: rgb
Xft.hinting: 1
Xft.hintstyle: hintfull

Is there an Xft or urxvt setting I can adjust to squeeze my text back down? The wide spacing is both inconvenient (because I can't fit as many columns in a window) and kind of ugly. Thanks!

Offline

#2 2008-09-22 23:11:54

BC
Member
Registered: 2008-01-29
Posts: 83

Re: urxvt font widths

I had the same problem (and made a post about it awhile back) but unfortunately never found a solution.  I eventually went back to xterm, though mostly for other reasons.  If you ever find a fix I'd love to hear it.

Offline

#3 2008-09-23 00:35:20

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: urxvt font widths

This sounds like a urxvt font width calculation issue, although I also have no solution.

urxvt calculates the width of *every* font glyph based on the widest character it finds in the font.

Since I like reading manpages (:P), I remember that urxvt has an option to change the padding/spacing between *lines*, but that doesn't help the font width.

-dav7


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#4 2008-10-18 12:40:23

roylez
Member
Registered: 2008-10-18
Posts: 6

Re: urxvt font widths

Hey guy,

This is an really old problem, but urxvt developers refused to admit that it was a bug. Please read

http://lists.schmorp.de/pipermail/rxvt- … 00514.html

Yes, there is a patch for that.

Offline

#5 2008-10-23 14:40:28

andywxy
Member
From: Winnipeg, Canada
Registered: 2007-09-27
Posts: 36

Re: urxvt font widths

Ah, yep, I also know this patch but how can I patch it while recompiling urxvt?

Could you please give a PKGBUILD or somewhat showing how to patch this?
Thanks.

Offline

#6 2008-10-23 14:47:21

kazuo
Member
From: São Paulo/Brazil
Registered: 2008-03-18
Posts: 413
Website

Re: urxvt font widths

Is not hard, the wiki have more info (look for abs).

First save the patch in a file (in the same dir as PKGBUILD), something like fix_char_width.patch and add a line for applying the patch:

  patch -p1 < doc/urxvt-8.2-256color.patch || return 1
  patch -p0 < ${startdir}/src/fix_char_width.patch || return 1

Redo the md5 with makepkg -g and compile it with makepkg.

Offline

#7 2008-10-24 01:46:03

andywxy
Member
From: Winnipeg, Canada
Registered: 2007-09-27
Posts: 36

Re: urxvt font widths

@kazuo

Thanks for your kind instructions! Now I know how to patch in the PKGBUILD, thankx!


And this morning I find that there is a package called rxvt-unicode-256color-fontfix in AUR, its awesome. Guys, why not give it a glance? :d

Last edited by andywxy (2008-10-24 01:46:40)

Offline

Board footer

Powered by FluxBB