Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

up vote 4 down vote accepted
+50

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 config.mk File and change

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

    to

    XFTINC = -I/usr/include/freetype2

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

    make
    sudo make install
    
share|improve this answer
1  
You could also use this ppa: launchpad.net/~chilicuil/+archive/sucklesstools –  chilicuil Sep 26 '13 at 7:33
    
Isn't sucklesstools included with i3 ? –  Saad Farooq Apr 26 at 22:09

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

Your Answer

 
discard

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.