[SOLVED] Can't get DejaVu Sans Mono to work with urxvt

Hi all,

I'm trying to use DejaVu Sans Mono (through the ttf-dejavu package) with rxvt-unicode — specifically rxvt-unicode-patched from AUR. When I run urxvt I simply get the following error:

urxvt: unable to load base font set, please specify a valid one using -fn, aborting.

Here's the contents of my .Xresources:

URxvt.scrollBar: off
URxvt.font: xft:DejaVu Sans Mono:pixelsize=11

And here's my .xinitrc:

xset +fp /usr/share/fonts/TTF
xset fp rehash
fc-cache -fv
xrdb -load ~/.Xresources
urxvt &
xmonad

Any help on this issue would be much appreciated. Let me know if there's any other information which might be useful.

Last edited by djb (2012-04-16 18:51:37)

Re: [SOLVED] Can't get DejaVu Sans Mono to work with urxvt

I use this:

URxvt.font: xft:Monospace:pixelsize=14.5

P.s., this part shouldn't be necessary:

xset +fp /usr/share/fonts/TTF
xset fp rehash
fc-cache -fv

It repopulates the font database each time you start x, which is quite a heavy operation.


ᶘ ᵒᴥᵒᶅ

Re: [SOLVED] Can't get DejaVu Sans Mono to work with urxvt

In my .Xresources I have this, and it works.

urxvt.font:     xft:DejavuSansMono:pixelsize=20

The name without spaces.

Last edited by Alber (2012-04-16 08:42:10)


Because not all of us are native English speakers, try no to use slang or abbreviations, thank you.

Re: [SOLVED] Can't get DejaVu Sans Mono to work with urxvt

A line taken from urxvt man page:

urxvt -fn "xft:Bitstream Vera Sans Mono:pixelsize=15"

Your Xdefaults config seems OK and it should work. You can clean your xinitrc as litemotiv pointed out because you don't need to rebuild your font db before every X session. However, if you use 'Monospace' instead of the font name, be sure you have a proper alias in your fontconfig directory, i.e. your system knows which font to use as Monospace; you can check it by issuing

fc-match Monospace

which in my case outputs

Consolas.ttf: "Consolas" "Regular"

The problem you're experiencing in most cases means that the application cannot read font parameters properly. To get rid of it, you may clean your font cache (/var/cache/fontconfig, $HOME/.fontconfig) and re-run (as user)

fc-cache -f -v

After restarting your X environment, things would probably work as expected.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts : good looking fonts made easy

Re: [SOLVED] Can't get DejaVu Sans Mono to work with urxvt

Thanks for the replies everyone.

Unfortunately I'm still unable to get things to work. I deleted all the files in ~/.fontconfig and /var/cache/fontconfig, ran fc-cache -f -v as user and cleaned my .xinitrc as per litemotiv's suggestion.

Here's the current state of things:

.xinitrc:

xrdb -load ~/.Xresources
urxvt &
xmonad

.Xresources (unchanged):

URxvt.scrollBar: off
URxvt.font: xft:DejaVu Sans Mono:pixelsize=11

Output of "fc-match Monospace":

DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

I was unable to get things working by trying "xft:Monospace:pixelsize=11" in my .Xresources.

I installed ttf-bitstream-vera and tried verbatim the urxvt -fn invocation from the man page (in boohomil's post) but received the same error.

Any ideas, anyone?

Re: [SOLVED] Can't get DejaVu Sans Mono to work with urxvt

Just a sanity check, what is the output of:
pacman -Qs dejavu
??
tongue


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way