Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found references at various places running dmenu like so :

dmenu_run -b -fn 'Inconsolata 12'

However, whatever variation of the font name I try, I always get dmenu: warning: cannot load font <font name>

fc-list | grep cons gives me:

/usr/share/fonts/truetype/inconsolata/Inconsolata.otf: Inconsolata:style=Medium

It does not show in xlsfonts and all the fonts that do show up with xlsfonts work fine.

What is the correct way to reference these fonts from command line ?

Also, is that a standard way to reference fonts or will it change when using programs like pango?

share|improve this question
Lol... dmenu only – Saad Farooq Aug 12 '13 at 18:45
up vote 8 down vote accepted

The standard version of dmenu doesn't include support for xft fonts. To use fonts like Inconsolata you'll need to build a patched version of dmenu.

  1. Download the source code and the patch.
  2. Open up a terminal, cd to the directory containing both the source code and the patch.
  3. Run the following commands to apply the patch:

    tar zxvf dmenu-4.5.tar.gz
    cd dmenu-4.5
    mv ../dmenu-4.5-xft.diff .
    patch -p1 < dmenu-4.5-xft.diff
  4. To build the modified version of dmenu, you'll need to have the following packages installed: libxft-dev libxft2 libxinerama-dev

  5. UPDATE on UBUNTU 14.04 the build fails with

    fatal error: ft2build.h: No such file or directory

    to fix this edit the File and change

    XFTINC = -I/usr/local/include/freetype2


    XFTINC = -I/usr/include/freetype2

  6. Run the following commands to build and install the modified version of dmenu:

    sudo make install
share|improve this answer
Isn't sucklesstools included with i3 ? – Saad Farooq Apr 26 '14 at 22:09
Clone from and apply patch from on master then make. chmod +x dmenu_path and install (or just add symlinks to dmenu, dmenu_run, dmenu_path, and stest). – Stephen Niedzielski Apr 13 '15 at 22:52

You must to use the X Logical Font Description (XLFD) full name for the font provided by xfontsel. For example, you can use something like this : -bitstream-*-*-*-*-*-12-*-*-*-*-*-*-*:

dmenu_run -b -fn -bitstream-*-*-*-*-*-12-*-*-*-*-*-*-*

xfontsell tool allows you to preview the different settings.

If you want to use a syntax like:

dmenu_run -b -fn <family>-<size>:<name>=<value>

which is closer to what you asked, you can use Xft support patch. See here the instructions about how to use a patch for dmenu.

share|improve this answer

Since dmenu 4.6 (released in Nov 2015), XFT font rendering is enabled by default (4.6 Release Notes) and this just works:

dmenu_run -fn 'Inconsolata 12'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.