5

I installed Ubuntu 18.04, and I want to customize the fonts. I have already change all the setting by tweak tool. But the system default font not be changed, is anything I need to do?

screenshot

screenshot

pomsky
  • 68,507
Pedro
  • 53

1 Answers1

5

The font for the texts highlighted in the screenshots you've posted is dictated by the GNOME shell theme.

Since generally it's not a good idea to edit system files (any update of an associated package will most probably overwrite it), you may create a custom css override in your home directory and load it from there. To do that, follow the steps below.

  1. Create a directory, say MyTheme in ~/.themes. (You may create ~/.themes if it doesn't exist.)
  2. Create another directory inside MyTheme called gnome-shell.
  3. Create an empty document in this gnome-shell directory and name it gnome-shell.css.
  4. Open this gnome-shell.css file with a text editor and add the following lines

    @import url("/usr/share/gnome-shell/theme/ubuntu.css");  
    
    stage {
        font-family: FONT_NAME, Sans-Serif;
    }
    

    Change FONT_NAME to the font of your choice and save the file.

  5. Install the GNOME extension called the User themes from here.

  6. Install (GNOME) Tweaks by running

    sudo apt install gnome-tweak-tool
    
  7. Launch Tweaks and go to Appearance section. Click on the drop-down box next to "Shell theme". MyTheme should appear in the drop-down list. Select it.

  8. Restart GNOME shell by pressing alt+f2 then typing r and hitting enter (works in an Xorg session, in Wayland logout and login again).

pomsky
  • 68,507
  • 2
    I do it step by step, and it success. Thank you so much, pomsky. It is useful to me, I learned a new function. – Pedro May 06 '18 at 12:33