Bug 2140356

Summary: Cantarell fonts do not render on Flatpak applications
Product: Red Hat Enterprise Linux 9 Reporter: Phil Baker <baker1tex>
Component: flatpakAssignee: Debarshi Ray <debarshir>
Status: CLOSED DUPLICATE QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: andras0602, bstinson, carl, debarshir, eng-i18n-bugs, jwboyer, mihai, petersen, tagoh, tpopela
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2144433 (view as bug list) Environment:
Last Closed: 2022-12-02 07:20:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2144433    
Bug Blocks:    
Attachments:
Description Flags
Flatseal app on CentOS Stream 9 none

Description Phil Baker 2022-11-06 01:22:13 UTC
Created attachment 1922465 [details]
Flatseal app on CentOS Stream 9

Created attachment 1922465 [details]
Flatseal app on CentOS Stream 9

Description of problem:
Cantarell fonts do not render on Flatpak applications. Instead, character-sized boxes are rendered. Screenshot attached. 

Version-Release number of selected component (if applicable):
CentOS Stream 9. Fresh install from the 1 November 2022 DVD install image. System is fully up to date.

How reproducible:
Always. I've reproduced it on two installs of CentOS Stream 9.

Steps to Reproduce:
1. Install CentOS Stream 9
2. Run 'sudo dnf update' to ensure all packages are up to date
3. Verify the flatpak rpm package is installed.
4. Enable Flathub support following the instructions here: https://flatpak.org/setup/CentOS
5. Open Files app, double-click downloaded 'flathub.flatpakrepo', which launches the Software app, which then installs the Flathub repo. 
6. Close and restart the Software app.
7. Search for any Flatpak, for example, Flatseal. Install it.
8. Run Flatseal from the GNOME search, or from the Software app.

Actual results:
9. Flatseal launches, but without any interface fonts. In the place of fonts are character-width boxes.

Expected results:
9. Flatseal app launches with font support.  

Additional info:
This issue does not occur on my RHEL 9.0 workstation.

Cockpit log is filled with entries similar to the following (newest at the top):
Started app-flatpak-com.github.tchx84.Flatseal-7130.scope.
failed to create cairo scaled font, expect ugly output. the offending font is 'Cantarell 11'
font_face status is: file not found

Using GNOME Tweaks to change the Interface Text font from Cantarell to Carlito fixes the problem - i.e. readable fonts are rendered. The problem returns when switching back to Cantarell Regular for the Interface Text.


Comment edited by author to correct typos - 6 November 1640 UTC

Comment 1 Carl George 🤠 2022-11-07 04:48:17 UTC
I was also able to reproduce this error on RHEL 9.0, fresh from the DVD with no updates applied, so it looks like it's been a problem from the start of EL9.

1. install RHEL 9.0 (Server with GUI)
2. setup Flathub per https://flatpak.org/setup/Red%20Hat%20Enterprise%20Linux
3. search for Flatseal in Gnome Software and install it
4. reboot (this step is important, it bug does not appear before reboot)
5. run Flatseal app

I was also able to reproduce this on Fedora 35, but not on Fedora 36.  Considering the version of abattis-cantarell-fonts is basically the same across all of these distro versions, I don't think that's where the problem lies.  I'm changing the component for this bug to flatpak to get more eyes on this, feel free to change it back if I'm missing something.

Comment 4 Andras Kovacs 2022-11-25 10:39:04 UTC
I had the same issue on RHEL 9.1 with multiple applications bundled with Flatpak.
I got the following solution from a user called "clojster" on Discord https://discord.com/invite/fedora in the server-rhel-centos room:

flatpak run --command=fc-cache com.github.tchx84.Flatseal  -f -v

Replace the name of the applications accordingly.
I had to also fix:
- org.gimp.GIMP
- fr.romainvigier.MetadataCleaner
The issue haven't returned yet.

Comment 5 Akira TAGOH 2022-11-29 06:59:23 UTC
If you use a flatpak application requiring Fedora flatpak runtime, this should be fixed with the latest runtime: https://bodhi.fedoraproject.org/updates/FEDORA-FLATPAK-2022-255485b1e4

We need a similar fix on RHEL9 for flatpak runtime after fixing fontconfig. we already have #2144433 for fontconfig so reassigning this to flatpak to keep this on track.

Comment 6 Debarshi Ray 2022-12-01 23:17:32 UTC
Thanks for tracking it down, Akira!

I am happy to help with rebuilding the RHEL 9 Flatpak runtime with the fontconfg fix, but I have also never built a Fedora or RHEL runtime before.  So, maybe I am not the best person to handle this?

Tomáš, any thoughts?

Comment 7 Debarshi Ray 2022-12-02 07:20:58 UTC
Tomáš suggested that this be closed as a duplicate of bug 2144433

Ultimately, we need a bug against flatpak-runtime-container, not flatpak, and he will create one with the right metadata.

*** This bug has been marked as a duplicate of bug 2144433 ***

Comment 8 Akira TAGOH 2022-12-02 09:55:23 UTC
If we can keep it on track, either way should works. thanks for taking care of it!