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?
1 Answers
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.
- Create a directory, say
MyTheme
in~/.themes
. (You may create~/.themes
if it doesn't exist.) - Create another directory inside
MyTheme
calledgnome-shell
. - Create an empty document in this
gnome-shell
directory and name itgnome-shell.css
. 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.Install the GNOME extension called the User themes from here.
Install (GNOME) Tweaks by running
sudo apt install gnome-tweak-tool
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.
Restart GNOME shell by pressing alt+f2 then typing
r
and hitting enter (works in an Xorg session, in Wayland logout and login again).

- 68,507
-
2I 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