Setting the Default Monospace font in XFCE

Date: 19 December 2011

I use XFCE4 on my box at work because it’s lightweight and still provides the features I want. I wanted to change the default font so that emacs used the font I wanted without having to change my .emacs file. Unfortunately, XFCE4 only lets you set system default but not the monospace font. Fortunately, XFCE4 uses fontconfig. All you need to do is edit $HOME/.fonts.conf and add this little XML snippet. (See the fonts.conf manpage.)

        <match target="pattern">
                <test qual="any" name="family">
                        <string>monospace</string>
                </test>
                <edit name="family" mode="assign">
                        <string>Terminus-9</string>
                </edit>
        </match>

If you have to create $HOME/.fonts.conf, make sure you wrap that snippet in <fontconfig> tags.