rxvt-unicode: Excessive font spacing

Bug #309792 reported by tlvince on 2008-12-19
130
This bug affects 25 people
Affects Status Importance Assigned to Milestone
rxvt-unicode (Ubuntu)
Undecided
Unassigned
Nominated for Karmic by Elfir3

Bug Description

Binary package hint: rxvt-unicode

I'm having a problem with font spacing in urxvt. All characters seem to have excessive white-space in between each other. I use DejaVu Sans Mono (size 8) and there is a big difference between xterm and urxvt.

Heres a mockup of what I mean: http://i35.tinypic.com/qsmp.png
(stolen from an ArchLinux forum post here: http://bbs.archlinux.org/viewtopic.php?id=55634 and another related
thread here: http://bbs.archlinux.org/viewtopic.php?id=44800)

My .Xdefaults looks like this:

urxvt.font: xft:DejaVu Sans Mono:size=8

tonfa (bboissin) wrote :

Using pixelsize=12 worked for me

inode77 (simon-gerber) wrote :

Using pixelsize argument does not help at all.
Issue is still there

Ubuntu 9.10 alpha 4.
options: perl,xft,styles,combining,blink,encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext,fade,transparent,tint,afterimage,XIM,frills,selectionscrolling,wheel,slipwheel,smart-resize,cursorBlink,pointerBlank,scrollbars=plain+rxvt+NeXT+xterm

summary: - Excessive font spacing
+ rxvt-unicode: Excessive font spacing
inode77 (simon-gerber) wrote :

Forgot to add:

rxvt-unicode (urxvt) v9.06 - released: 2008-06-15

Harald (harald-kirsch) wrote :

Someone is discussing the issue over there.

http://lists.schmorp.de/pipermail/rxvt-unicode/2009q2/001008.html

I am a long term user of rxvt-unicode, but the current display of all fonts provided on ubuntu is unbearable. It may be an Xft problem, but I just cannot work with this overly wide spacing between the letters.

The interesting bit is, that on Intrepid, I just had to make sure that gnome-settings-daemon is started before the rxvt-unicode. Then letter space was ok. But when I first started the urxvt, the letter spacing was wrong.

Now on Karmic Koala, starting in the proper order does not help.

tremby (tremby) wrote :

Like you, I found this problem unbearable -- I don't feel comfortable unless the letters are exactly 1 unit wide, 2 units high.

I can't remember exactly where I got this from but if you Googled the fella's name and some of the patch content I imagine you'd find it.

The attached patch adds a letterSpace option which you can set to a negative value to crunch the letters together. It works fine along with the 256 colour patch. (Though I can't get it to compile at all even without patches on Karmic, 64 or 32 bit, but that's in the bug I'm going to report right after posting this...)

You then add the line

URxvt.letterSpace: -1

to your .Xdefaults.

I found that on I need this on my work machine and my laptop but not on my home desktop. I'm not sure why -- possibly something to do with the DPI values of the screens.

Ilya Zakreuski (zlj) wrote :

I'm able to reproduce this on a newly installed Lucid system.

Guys, upstream changelog for rxvt-unicode version 9.07 indicates that
patch mentioned by tremby already merged upstream. I've prepared
packages (lucid, karmic) which could be installed from this PPA:
https://launchpad.net/~zlj/+archive/ppa-experimental

I'd appreciate any feedback on that.

The following .Xdefaults settings have fixed issue for me after
installation of rxvt-unicode 9.07:

urxvt.font: xft:DejaVu Sans Mono:pixelsize=12
urxvt.letterSpace: -1

Changed in rxvt-unicode (Ubuntu):
status: New → Confirmed
Arnaud Soyez (weboide) wrote :

I gave it a try and I have to use:
urxvt.font: xft: Monospace:pixelsize=12
urxvt.letterSpace: -5
to make it work, but it's still not ideal as some characters still touch each other or are far too apart...

kevind (kevind256) wrote :

I downloaded and installed on my Lucid system package rxvt-unicode (9.07-2) for Maverick, and bug still persists, URxvt.letterSpace doesn't do a thing. Damn it urxvt, could you ever learn to show fonts properly?..

kevind (kevind256) wrote :

Sorry, have to take that back - URxvt.letterspace works (I just kept starting urxvtc without restarting daemon).

So, the following lines provide spacing close to normal for me:

URxvt.font: xft:DejaVu Sans Mono-8:autohint=true
URxvt.letterSpace: -2

But spacing is still slightly incorrect and some characters touch, like Arnaud wrote. That is, if I compare output to Terminator's, I see the latter slightly better positioning letters.

Therefore, bug still persists, URxvt.letterspace just fixes it partially (and spacing should be correct without additional parameter anyway).

Marcin Kulik (sickill) wrote :

I have the same issue.

URxvt.letterspace fixed the problem partially, fonts still doesn't look as good as in other (gnome and non-gnome) apps.

I just switched from Archlinux to Ubuntu. I was using urxvt for years on Archlinux and was rendering my fonts fine, the same way as the rest of the desktop.

I don't think letterspace option is needed here. If it works fine on other distros without this patch then it should be possible to make it work on Ubuntu. Maybe it's some configure/compile time switch/option related to Xft?

Adam Brockett (adam-brockett) wrote :

I don't really know the history behind this issue, but i did some digging/testing.

When i configure my ~/.Xdefaults as only:
    URxvt.font: xft:Monospace
I get the behavior described in this bug. If I do a `xrdb -merge ~/.Xdefaults` from the command line, I get no change in behavior. HOWEVER, if I instead execute `xrdb -load ~/.Xdefaults`, then open a new terminal, line spacing is proper. Looking at the scripts in the /etc/ directory, i believe Ubuntu loads the ~/.Xdefaults using -merge.

Digging deeper with xrdb -query, I added added the following line to my .Xdefaults:
    Xft.rgba: rgb

Then the problem re-appears.

Workaround for issue described in bug:
run `xrdb -load ~/.Xdefaults` sometime early in the xinit process.
letterspace patch seems hackish if issue can be worked around as above

kevind (kevind256) wrote :

Adam, thanks for testing, but your workaround doesn't seem to work for me. Is it possible to use xrdb -load for a file that (apparently) has already been loaded with xrdb -merge? Editing a file and calling xrdb -load like you did doesn't change the issue for me.

Two more workarounds however are (since the problem is apparently with XFT):

- Use non-FreeType font like in the following line:
URxvt.font: -misc-fixed-bold-r-normal-*-13-*-*-*-*-*-*-*

- Disable XFT (then you could leave FreeType font) with the following ~/.fonts.conf (correct the dir):
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <dir>/home/kevin/.Fontmatrix/Activated</dir>
 <match target="font">
  <edit name="antialias" mode="assign">
   <bool>false</bool>
  </edit>
 </match>
</fontconfig>

kevind (kevind256) wrote :

I mistaken, you do not need to have that <dir> entry at all, unless it was added by Fontmatrix program like it was for on my system. Add remember that this will disable XFT system-wide. You need to add the following entries in ~/.fonts.conf in their respective sections:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit name="antialias" mode="assign">
   <bool>false</bool>
  </edit>
 </match>
</fontconfig>

Brian (rephorm) wrote :

As per Adam's comment (#11) the Xft.rgba resource value definitely triggers this issue.

Adding Xft.rgba: none to your .Xresources file fixes the font width issue.

Alternatively, for quick testing, you can do:
    echo "Xft.rgba: none" | xrdb -merge

I've attached a screenshot showing the difference between values "rgba" and "none" for this resource.

Simon Hirscher (codethief) wrote :

I second the comments regarding Xft.rgba: Omitting it (or setting it to none) fixes the issues for the time being.

Simon Hirscher (codethief) wrote :

Adding to my previous message, I noticed that 'Xft.hintstyle: hintslight' (instead of hintfull) also triggers too big a letter spacing, though not as excessive as with 'Xft.rgba: rgb'. Full example:

Xft.dpi: 96
Xft.antialias: true
Xft.rgba: none
Xft.hinting: true
Xft.autohint: true
Xft.hintstyle: hintslight

Tomáš Karger (tomak) wrote :

Affects me too on 16.04. As I run i3 I noticed that the bug is only present when I run unity-settings-daemon. Otherwise, the fonnt spacing is ok.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers