ubuntu / gnome-sdk

GNOME SDK/Platform snap
22 stars 24 forks source link

More fonts are needed to avoid breaking rendering #49

Closed lissyx closed 2 years ago

lissyx commented 2 years ago

As documented on https://bugzilla.mozilla.org/show_bug.cgi?id=1767925 the fontconfig is missing some bits. This results in Firefox Snap package showing poor rendering both of webpages as well as PDF documents.

Copying everything using the following ensures the same rendering on both sides:

mkdir ~/snap/firefox/current/.config/fontconfig/conf.d; cp /etc/fonts/conf.d/* ~/snap/firefox/current/.config/fontconfig/conf.d

Screenshot_ubuntu22 04_2022-07-05_16:08:03

lissyx commented 2 years ago

Screenshot_ubuntu22 04_2022-07-21_16:17:17

seb128 commented 2 years ago

so the issue there is that some of the /etc/fonts/conf.d files are not available in the snap, the directory has some entries which symlinks to ../conf.avail, which are there in the snap but some other are pointing to /usr, example

/etc/fonts/conf.d/61-urw-nimbus-roman.conf -> /usr/share/fontconfig/conf.avail/urw-nimbus-roman.conf

could snapd perhaps make /usr/share/fontconfig/conf.avail/ also available in the snap env?

seb128 commented 2 years ago

I've also reported a snapd issue about it on https://bugs.launchpad.net/snapd/+bug/1982577

lissyx commented 2 years ago

So what would be a legit fix, modifying the common/desktop-exports script to take into account more fonts, or fix snapd itself ?

seb128 commented 2 years ago

So what would be a legit fix, modifying the common/desktop-exports script to take into account more fonts, or fix snapd itself ?

Since snapd already gives access to the conf.d/conf.avail it would probably make sense to include now the new directory in /usr/share/fontconfig, the snapd team seemed ok on principle with a such change.

jhenstridge commented 2 years ago

We've avoided using the host system fontconfig configuration because it was prone to triggering incompatibilities. In particular, the config file parser treats any unknown element as a hard error.

This last popped up when fontconfig added <its:rules> elements to its default configuration file, which caused older libfontconfig versions to complain and fall back to their builtin configuration. There hasn't been any config file additions for quite a while, but we'd risk old snaps breaking should new syntax be introduced.

I think either of these options would be appropriate:

  1. include the URW fonts in the gnome platform snap
  2. include the fontconfig rules for the URW fonts in the gnome platform snap's fontconfig configuration, and hope that the URW fonts are available.
seb128 commented 2 years ago

After discussion we decided to bundled the fonts configuration from a default installation which should give a consistent behaviour with non snapped applications, submitted for review as #72 now. Going forward we want to work with the fontconfig upstream in a way to tag the configuration version in a way which would allow us to import the compatible system configuration

lissyx commented 2 years ago

Thanks @seb128 for #72. I see it has been merged, how long until it gets built and pushed to the Snap store? Can we close this issue ?

seb128 commented 2 years ago

Thanks @seb128 for #72. I see it has been merged, how long until it gets built and pushed to the Snap store? Can we close this issue ?

We should have a build in the candidate channel in some hours, then it takes usually a bit longer to validate those and move them to stable, probably next week since we usually avoid to push stable updates on a friday

seb128 commented 2 years ago

the new snap is available in candidate now

lissyx commented 2 years ago

the new snap is available in candidate now

Thanks, I've been able to locally verify that it is properly the issue.

lissyx commented 2 years ago

https://bugzilla.mozilla.org/show_bug.cgi?id=1794259#c10