How can I change system font values for specific applications?

As the title asks, I'm wondering if it's possible to change an application's understanding of which fonts are used for the Interface Text and Document Text values in Gnome.

Context:

I generally use TablePlus when working with SQL Server, PostgreSQL, and MySQL databases. It's a closed-source application, which means I do not have the luxury of reaching into the code and changing the fonts that are used within the application.

Because it is a SQL editor, monospaced fonts are the only realistic option to use. An l must look like an l and not a 1. I can get the application to use monospaced fonts in the interface if I change the Interface Text and Document Text values in Gnome Tweaks, but I do not want to make everything in Ubuntu monospaced, as that's overkill (besides, I like the Ubuntu font).

On the left is what I have, and on the right is what I want to see (in the editor and results spaces only, but one battle at a time):

Table Plus Minus the Preferences

So, if the application is reading the Interface Text and Document Text values from the Gnome interface settings, I would like to have the application use a font of my choosing. There is an outstanding issue requesting the ability to change the font settings within the application already, but it has not been implemented.


One possible solution is to make it look for the configuration in a different location than the usual place.

With a reasonably well-behaved modern tool, configuration should be in $XDG_CONFIG_HOME (defaults to $HOME/.config), so setting XDG_CONFIG_HOME to some other directory and keeping a copy of your desired configuration there should work (this should be true of GNOME Tweaks itself). However, not everything supports the XDG specification yet, and especially in the case of proprietary applications, you might need to be more blunt and set HOME instead. (Particularly bad applications may even try to get HOME from NSS, and ignore the HOME environment variable.)

The GSettings/DConf configuration is stored in $XDG_CONFIG_HOME/dconf (~/.config/dconf by default). You can change the font, then copy that directory somewhere else, and run the offending application with XDG_CONFIG_HOME (or HOME, if it's not well-behaved) set to point there.