Configuring Fonts for Thunderbird snap to Display Fonts Nicely

Posted on In Linux, Software

snap is a software app bundle with dependencies included so that it can works in different Linux distributions. However, as most other software, snap has compatiblity issues. An app in the snap format is not 100% the same and compatible with the native version. One of the problem I find is that Thunderbird from snap may not show some fonts correctly. In this post, we will discuss how to configure fonts for Thunerbird snap to make the fonts display correctly. The example in this post is using Ubuntu 20.04.

The reason: the fontconfig in snap

Let’s find out the reason. Thunderbird snap has its own fonts.conf file under ~/snap/thunderbird/current/.config/fontconfig/fonts.conf. The content looks like

<fontconfig>
  <dir>/home/linuxuser/.local/share/fonts</dir>
  <dir>/home/linuxuser/.fonts</dir>
  <dir>/snap/thunderbird/138/gnome-platform/usr/share/fonts</dir>
  <dir>/usr/local/share//fonts</dir>
  <dir>/usr/share//fonts</dir>
  <cachedir prefix="xdg">fontconfig</cachedir>
  <cachedir>/var/snap/thunderbird/common/fontconfig</cachedir>
</fontconfig>

However, it seems the system wide configuration files paths (/etc/fonts/conf.d and /etc/fonts/fonts.conf) are not included for some reasons.

The fix: adding the system fonts and config paths

Knowing the possible reason, we now can have our “fix”. We can add the system wide fonts configuration files paths into the fonts.confg file ~/snap/thunderbird/current/.config/fontconfig/fonts.conf:

  <include ignore_missing="yes">/etc/fonts/conf.d</include>
  <include ignore_missing="yes">/etc/fonts/fonts.conf</include>

For the Thunderbird snap, the fonts.conf will look like

<fontconfig>
  <include ignore_missing="yes">/etc/fonts/conf.d</include>
  <include ignore_missing="yes">/etc/fonts/fonts.conf</include>
  <dir>/home/linuxuser/.local/share/fonts</dir>
  <dir>/home/linuxuser/.fonts</dir>
  <dir>/snap/thunderbird/138/gnome-platform/usr/share/fonts</dir>
  <dir>/usr/local/share//fonts</dir>
  <dir>/usr/share//fonts</dir>
  <cachedir prefix="xdg">fontconfig</cachedir>
  <cachedir>/var/snap/thunderbird/common/fontconfig</cachedir>
</fontconfig>

Then restart Thunderbird. It will use the system level fonts and fonts configurations and the fonts should display correctly now.

Note that with this method, if the Thunderbird snap is upgraded, the fonts.conf file should be edited again. I would expect there will be some fixes from the Thunderbird snap itself for a long term solution.

Leave a Reply

Your email address will not be published. Required fields are marked *