Adding Subpixel Rendering to Emacs on Linux (Wayland)

If you’ve wondered why fonts look weirdly chonky, crispy, too dark, perhaps too pixelized, too contrasty or all of the above in Emacs, you might just be missing a setting.

For me, I had to manually use GNOME’s weird binary database utility to set the following option, even though I don’t use GNOME:

gsettings set org.gnome.desktop.interface font-antialiasing 'rgba'

And restart Emacs. The reasoning behind this is that basically everyone on Linux respects the Fontconfig settings, so if you set your subpixel rendering in Plasma, for example, they are written to ~/.config/fontconfig/fonts.conf. You get a nice Plasma GUI for this. It works the same in most other desktop environments.

But the GNOME team had different ideas, they store their settings in a binary database ~/.config/dconf/user. The safest way to change settings in there is using gsettings, a CLI tool. Emacs uses these settings on GNU/Linux because it uses GTK and/or (couldn’t figure it out) Cairo for font handling. And GTK relies on that database too.

There seems to be no way to override this using your Emacs configuration files, so you’ll just have to remember to make that change on every new machine. Hurray for standards.