Font issue with Flatpaks

Hello good people of UM,

I have another issue with the text in flatpak apps not showing up correctly. This is clearly some sort of issue with the installed fonts. I've had a search online to find a solution but no luck. I'm using UM 20.04. The 2 apps with the issue so far are green with envy & markets. You can see the problem I have by looking at the screenshot from markets below:

Thank you all for your help & advice!

This sounds suspiciously similar to: Text becomes a bunch of missing characters.

Thanks @gordon this is exactly my issue! The solution from @saivinob doesn't work on the flatpaks as I can't find the equivalent of this fontconfig folder for the 2 flatpaks:

rm ~/snap/discord/common/.cache/fontconfig/*

I'll log a bug with the 2 devs and see what they say. Thanks for all your help! :slight_smile:

UPDATE: After logging the bug on gitlab, I had to paste the output from the console, here's what that output looks like, there's an issue with loading 2 gtk modules:

Gtk-Message: 10:48:09.689: Failed to load module "appmenu-gtk-module"
Gtk-Message: 10:48:09.689: Failed to load module "canberra-gtk-module"

(gwe:2): Pango-WARNING **: 10:48:10.262: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto 12'

(gwe:2): Pango-WARNING **: 10:48:10.262: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.262: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.272: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto 15'

(gwe:2): Pango-WARNING **: 10:48:10.272: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.272: scaled_font status is: file not found
/app/lib/python3.8/site-packages/gwe/di.py:54: Warning: invalid cast from 'GtkHeaderBar' to 'GtkMenuShell'
builder.add_from_resource(_UI_RESOURCE_PATH.format(APP_MAIN_UI_NAME))

(gwe:2): Pango-WARNING **: 10:48:10.593: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto Bold 12'

(gwe:2): Pango-WARNING **: 10:48:10.593: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.593: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.600: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto Bold 15'

(gwe:2): Pango-WARNING **: 10:48:10.600: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.600: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.612: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto Light 12'

(gwe:2): Pango-WARNING **: 10:48:10.612: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.612: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.620: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto Light 15'

(gwe:2): Pango-WARNING **: 10:48:10.620: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.620: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.835: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto Italic 12'

(gwe:2): Pango-WARNING **: 10:48:10.835: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.835: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.842: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto Italic 15'

(gwe:2): Pango-WARNING **: 10:48:10.842: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.842: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.880: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto 14.3994140625'

(gwe:2): Pango-WARNING **: 10:48:10.880: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.880: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.888: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto 17.9990234375'

(gwe:2): Pango-WARNING **: 10:48:10.888: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.888: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.896: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto 20.734375'

(gwe:2): Pango-WARNING **: 10:48:10.896: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.896: scaled_font status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.904: failed to create cairo scaled font, expect ugly output. the offending font is 'Roboto 25.9189453125'

(gwe:2): Pango-WARNING **: 10:48:10.904: font_face status is: file not found

(gwe:2): Pango-WARNING **: 10:48:10.904: scaled_font status is: file not found

That's it for now! I'll post an update when I have a solution :slight_smile:

1 Like

The important part is not the "Failed to load ..." text; it's all the lines which say that the font files couldn't be found. Neither GTK module has anything to do with text rendering -- one produces event sounds like "boom" when an error occurs, while the other transfers the application's menu bar to the top panel if you're using the Mutiny panel layout.

Nevertheless, good luck. Alas, I can't debug this since I don't have any Flatpaks. (OK. I'll admit: I could get a Flatpak to test this on. But that's outside my current scope of knowledge.)

Thanks @gordon for all your input!

I have troubleshooted a quick workaround for this - I changed the system font to Ubuntu regular - and voila! - the text magically reappears for both flatpaks!

Now I'm waiting for the concrete answer/solution from the app devs. Once I have this - I'll post their solution to this thread.

I wonder if the Ubuntu fonts are shipped with the Flatpak but not the Roboto fonts? Maybe the Flatpak provides certain fonts and is somehow over-restricted to not even being allowed to use system fonts? That's just my W.A.G, though.

Going from all my troubleshooting & search engine trawling to find a solution - you're contention is close to reality. It could be either option - or both! That's why I'm really curious to see what the app devs say :slight_smile:

I got an answer from the app dev for Green with envy, the command he gave me to refresh the font cache didn't work but he gave me a link to a Github issue thread with the same issue:

To save someone scrolling through the entire thread (it's long) - here's the command that worked in the end:

flatpak run --command=fc-cache com.leinardi.gwe -f -v

Just substitute the flatpak package name for com.leinardi.gwe & you're good to go! :slight_smile:

Update: I have to run the above command every time I install a new Flatpak - which means that this is a systemic Flatpak issue - c'est la vie!

1 Like