Different font rendering for native packages and flatpaks using fractional scaling

I’m using Bluefin on a Framework laptop with the original display with a resolution of 2256x1504. Using fractional scaling, I usually have it set at 125% or 150%. I have noticed that the font rendering in flatpaks is really fuzzy, and after some testing around I’ve noticed that:

  • Font rendering in native apps is always good, no matter how the scaling is set.
  • Flatpaks have fuzzy rendering at fractional scaling (175%, 150%, 125%, etc…), but look good at 100% or 200%.
  • Aurora does not seem to be affected.

This is most obvious when viewing PDFs.

Top part is with the native viewer Evince. The lower bit is with the flatpak installation of Foliate.

Anybody have an idea why this is?

It is most probably not specific to Blufin. I suggest to ask flatpak like questions to flathub.org forum, because you will most probably get way better feedback from flatpak experts.

Flatpaks do not import complete host fonconfig because fontconfig versions between host and flatpak might differ and config file formats are not compatible: [feature] Expose xdg-config/fontconfig to sandbox by default · Issue #3947 · flatpak/flatpak · GitHub

I was unhappy with flatpak Brave font rendering and it helped to create local customized fonts.conf in ~/.var/app/com.brave.Browser/config/fontconfig/

How does your fonts.conf look like? I copied over my configuration from ~/.config/fontconfig and it did nothing.

My fonts.conf looks like this:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <match target="font">
    <edit mode="assign" name="antialias">
      <bool>true</bool>
    </edit>
    <edit mode="assign" name="embeddedbitmap">
      <bool>false</bool>
    </edit>
    <edit mode="assign" name="hinting">
      <bool>true</bool>
    </edit>
    <edit mode="assign" name="autohint">
      <bool>false</bool>
    </edit>
    <edit mode="assign" name="hintstyle">
      <const>hintslight</const>
    </edit>
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
    <edit mode="assign" name="rgba">
      <const>rgb</const>
    </edit>
  </match>
</fontconfig>