9

I installed the patched font "Source Code Pro" from https://github.com/ryanoasis/nerd-fonts#option-3-install-script on my Ubuntu 18.10 box.

I can see the font showing up on the Fonts program (as SauceCodePro).

I want to set it as the font for GNOME Terminal app (Edit -> Preferences -> Custom Font), however this font doesn't show up.

I have tried running sudo fc-cache -fv ~/.local/share/fonts, as well as restarting my computer. I also tried reinstalling the gnome-terminal package, but no dice.

Does anyone have any suggestion for what I could do here?

1
21

Thanks to @egmont's link to https://askubuntu.com/questions/1046871/nerd-font-not-fond-in-terminal-profile/, I figured out a way to get around this, as mentioned in one of the comments in that post:

  • Install GNOME Tweaks
  • Set the system monospace font to "SauceCodePro Mono Regular"
  • In the Terminal's Font Preference, I leave the Custom Font option unchecked, .i.e use system font.
2
2

This is a bug with gnome-terminal.

A workaround is to set the font of a gnome-terminal profile by using dconf.

First you will need to find out the id of your profile:

dconf dump /org/gnome/terminal/legacy/profiles:/

This will output information for all your profiles. Grab the id of the profile you want to set the font for, it should look something like :b1dcc9dd-5262-4d8d-a863-c897e6d979b9 and then set the font for that terminal by running:

dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/font  "'<chosen_font_name> <font_size>'"

The double quoting is important, I don't know why but you need to doubly quote your font and size.

So for example I used this to set a font I patched with nerd fonts with a size of 13, and the command was:

dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/font  "'UbuntuMono Nerd Font Mono 13'"

Note use-system-font should be false, you can set this by ticking 'Custom font' in the profile options dialog or set it via dconf.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.