Change default theme font settings of gnome-shell

Although I’ve post how to make the DROID font as the default font family in Ubuntu, the works have no 100% work in default gnome-shell theme. In summary the steps to set DROID font globally are:

  1. Make sure the font priority is the highest one. Ref: Use droid font as default on Ubuntu 12.04
  2. Install the gnome-tweak-tool and use it to make all the FONT family settings are Sans and Monospace.
  3. Re-login and it works.

However, the top panel and some UI still use the cantarell as default font (since version 3.6, I guess). We should substitute them to make an uniform UI. I’ll introduce two ways as follows:

1. Alter the gnome-shell CSS directly. It is simplest and perfect. However, the settings will be OVERWRITE after upgrading gnome-shell. The steps are:

$ sudo vim /usr/share/gnome-shell/theme/gnome-shell.css

You will see the stage block (in my system, it is at Line 24) as:

/* default text style */
stage {
font-family: cantarell, sans-serif;

Then delete the cantarell font family setting as:

/* default text style */
stage {
font-family: sans-serif;

Then it works when you re-login.

2. Use a local .fonts.conf to override font settings. It is a per-user work but still a feasible solution.

$ vim ~/.config/fontconfig/fonts.conf

Then copy the following settings, paste and save.

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

        <match target="pattern" name="family">
                <test name="family" qual="any">
                <edit name="family" mode="assign" binding="same">


After re-login or restart gnome-shell, it works.

The above two are for top-panel/UI font family that the gnome-tweak-tool cannot alter to. Moreover, the font-size of top panel is also controlled by the theme CSS. If you want to alter the default top panel font size, please alter the css file manually. Enjoy it. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *