You are not logged in.

#1 2012-04-17 20:44:33

ioos
Member
Registered: 2011-01-25
Posts: 125

[SOLVED] Changing font in urxvt, what's available?

I'm trying to change the font used in urxvt. Currently my .Xresources has the line:

URxvt.font: xft:terminus:size=9

This appears to be working. However, I'm not sure how to find the correct name for other fonts. The wiki says to look in /usr/share/fonts/misc/fonts.alias Mine can be found here: http://pastebin.com/EPH3DdWT

Apparently those full names work for bitmap fonts and the syntax I used above is for xft fonts.

As an example, say I'd like to set my urxvt font to Oxygen Mono. How do I determine if that font uses bitmap or xft? If bitmap, how do I find the full name in fonts.alias? If xft, how do I find the name to be used? ("oxygen mono", "oxygen-mono", etc)

Last edited by ioos (2012-04-18 21:47:11)

Offline

#2 2012-04-17 20:47:16

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Changing font in urxvt, what's available?

man urxvt
rxvt-unicode @ ArchWiki
man fc-list


:: Registered Linux User No. 223384

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

Offline

#3 2012-04-17 21:03:41

ioos
Member
Registered: 2011-01-25
Posts: 125

Re: [SOLVED] Changing font in urxvt, what's available?

I'd already read the first two suggestions. They didn't contain the answer.

Using "fc-list -v" I found the line "fullname: "Oxygen Mono"(s)".

Changing the setting to "URxvt.font: xft:Oxygen Mono:size=10" in .Xresources worked. Although, I'm still not sure how I was supposed to determine that it was an xft font (without guessing).

Offline

#4 2012-04-17 21:25:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] Changing font in urxvt, what's available?

AFAIK, xft fonts are true type fonts and would be found in /usr/share/fonts/TTF


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2012-04-17 21:41:47

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Changing font in urxvt, what's available?

Why don't you simply read what libxft is all about?

libxft    2.3.0-2    FreeType-based font drawing library for X

-- seems to be self explanatory.

If you take a look at

man urxvt

you'll find the following passus:

In short, to specify an X11 core font, just specify its name or
prefix it with "x:". To specify an XFT-font, you need to prefix
it with "xft:", e.g.:

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

See also the question "How does rxvt-unicode choose fonts?" in
the FAQ section of urxvt(7).

which provides an example to start with.


:: Registered Linux User No. 223384

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

Offline

#6 2012-04-17 21:42:27

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [SOLVED] Changing font in urxvt, what's available?

Trilby wrote:

AFAIK, xft fonts are true type fonts and would be found in /usr/share/fonts/TTF

Which means that, since urxvt supports xft fonts, you can choose any font you think might be suitable.  Obviously, flowing script is out of the question, but any kind of well-defined, bitmap-style font you find should work.

Offline

#7 2012-04-17 22:36:11

ioos
Member
Registered: 2011-01-25
Posts: 125

Re: [SOLVED] Changing font in urxvt, what's available?

Trilby wrote:

AFAIK, xft fonts are true type fonts and would be found in /usr/share/fonts/TTF

Hmm, the Oxygen fonts are actually installed to /usr/share/fonts/Oxygen-Regular, but they still work using the xft full name. I guess the idea is the same though.

bohoomil, I don't think you're understanding my questions. I have read those.

Anyway, I've got it figured out now. Thanks for the replies everyone!

Offline

#8 2012-04-17 22:40:43

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] Changing font in urxvt, what's available?

To figure out xft and fontconfig took me quite a bit of trial and error.  ' man fc-list' is not very helpful, the docs in '/usr/share/doc/fontconfig/' are better.  'fc-list' lists more than just TTF and OTF fonts.

$ fc-list : | sort   ## list all fonts and styles known to fontconfig
$ fc-list -f "%{family}\n" :lang=ja    ## list all japanese font families
$ fc-list -f "%{family} : %{file}\n" :spacing=100 | sort    ## list monospace fonts by family and file
$ fc-list :style=Bold | sort    ## all bold fonts
# fc-list -f "%{file} " | xargs pacman -Qqo | sort -u    ## list font packages installed by pacman

It was not an easy Google search to find examples when I first tried to learn how to use fc-list.

Last edited by thisoldman (2012-04-17 22:41:42)

Offline

#9 2012-04-17 23:11:45

ioos
Member
Registered: 2011-01-25
Posts: 125

Re: [SOLVED] Changing font in urxvt, what's available?

Thanks thisoldman, those queries work well. Is there a way to filter them by file type? Is it just TTF and OTF that work with urxvt?

Offline

#10 2012-04-18 01:33:46

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] Changing font in urxvt, what's available?

If you installed xorg-fonts-100dpi or xorg-fonts-75dpi or the artwiz-fonts you would have quite a few pcf fonts, such as Courier and Lucida Typewriter.  Many show up when I list monospace fonts.  fc-list is used to list and filter the fonts that fontconfig knows.  If you want to know most of the options a particular font has, you use th '-v' option to fc-list.  '-f' is used to format and filter the information that is in the output.

$ fc-list -f "%{file}\n" :spacing=100 | grep pcf  ## monospace pcf font files
/usr/share/fonts/100dpi/lutBS19.pcf.gz
/usr/share/fonts/artwiz-fonts/smoothansi.pcf
    ...<cut>

Try the difference between something like these two commands:

$ fc-list :family=LucidaTypewriter:style=Sans  ## then try...
$ fc-list -v :family=LucidaTypewriter:style=Sans

You should be able to figure out the different font properties by referencing the documentation.  A font does not have to include all (any?) of the font properties given in the fontconfig docs.

Last edited by thisoldman (2012-04-18 01:34:26)

Offline

#11 2012-04-18 03:23:08

cupantae
Member
Registered: 2010-03-15
Posts: 18

Re: [SOLVED] Changing font in urxvt, what's available?

pacman -S xorg-xfontsel gtk2fontsel

xfontsel shows you all the X11 fonts. gtk2fontsel shows you the xft fonts. You put those in Xdefaults like this:

Rxvt*font:			-*-clean-medium-r-*--12-*-*-*-*-*-*-*
Rxvt*font:			xft:Bitstream Vera Sans Mono-8

(respectively)

To me, this is the most sensible way to do it, because you can try out fonts without actually having to set them and spawn a new urxvt.


By the way, I didn't read any of the posts above me.

Offline

#12 2012-04-18 21:46:40

ioos
Member
Registered: 2011-01-25
Posts: 125

Re: [SOLVED] Changing font in urxvt, what's available?

xfontsel is exactly what I needed.

Thanks again for the help everyone.

Offline

Board footer

Powered by FluxBB