github soundcloud
URxvt fonts
Dec 9, 2018
2 minutes read

To set the rxvt-unicode font, we must use set the configuration in the X resource database (xrdb). These can be loaded through the .Xresources file in your home directory.

The syntax for defining X resources:

<WM_CLASS>.<option>: <value>

To find <WM\_CLASS>, run xprops and click on the window you want to configure.

is “font”.

URxvt can use X FreeType interface library (xft), which renders the font client-side and sends an image to the X server, which means that can be:

xft:<family>-<size>:<name>=<value>...

See Keith Packard’s XFT Tutorial for more information.

is found by running:

fc-list : family

To list all fonts formatted as a URxvt X resource:

fc-list : family style -f 'URxvt.font: xft:%{family}-11\n'

After you have edited .Xresources, you have to merge it into the xrdb.

xrdb -merge ~/.Xresource

extras

For fc-list, the colon is a search query which matches everything (so all fonts are listed).

For the rest you should do man fc-list and man FcPatternFormat.

List what’s in the X resources database:

xrdb -query

List X resources being used by a WM\_CLASS:

appres URxvt

appres is from the xorg-appres package.

About WM\_CLASS:

… the name specified as part of WM\_CLASS is the formal name of the application that should be used when retrieving the application’s resources from the resource database.

And:

The WM\_CLASS property (of type STRING without control characters) contains two consecutive null-terminated strings. These specify the Instance and Class names to be used by both the client and the window manager for looking up resources for the application or as identifying information.

sources


Back to posts