Patched fonts not showing up on gnome-terminal

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.

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.