Ubuntu 23.04 shows squares as the font instead of text

Ubuntu 23.04 running the standard Gnome destop environment on a Thinkpad T430 laptop.

Problem

At some point (a few) applications started to show squares instead of the expected readable font. Where it was noticed was in the window dialogs when trying to save or open files. So not the full appliation itself.

This is not a bug in the applications itself, but something happened with the font cache.

BeeKeeper example:

BeeKeeper showing squares instead of the font

And Hey mail example:

Hey mail showing squares instead of the font

Both installed with Snap.

Solution

Close the application(s) in question first. (Or reboot afterwards).

Clear out your local font cache and re-generate it (probably not going to work):

rm -rf ~/.cache/fontconfig
sudo fc-cache -r -v

Expect to see fc-cache: succeeded when done.

What will probably maybe work is to go after the Snap font cache for each application:

find ~/snap/ -name 'fontconfig'

This will give you a lot of directories, depending on how many snaps you have installed.

It might not hurt too much to delete them all, but for the purpose of this we’ll only focus on the applications that are not working as expected.

Let’s delete them:

rm -rf /home/bendoin/snap/hey-mail/22/.config/fontconfig
rm -rf /home/bendoin/snap/hey-mail/common/.cache/fontconfig
rm -rf /home/bendoin/snap/beekeeper-studio/217/.config/fontconfig
rm -rf /home/bendoin/snap/beekeeper-studio/common/.cache/fontconfig

That should work™.

As mentioned above, make sure to restart the appliation if it was running during the time of deletion.

For the last section, here are a few questions that we did not have time to look futher into:

  • Is ok/wise/good to just delete all the fontconfig directories?
  • How do find the corrupt ones?

Make sure to always keep your Operating System(s) and all of the software that you are using up to date.

Feedback on our content or did you find a bug somewhere?

Send us an email to feedback at this domain.

kthxbai