#1028643 fontconfig: 2.14.1-3 greatly changes font rendering

Package:
fontconfig
Source:
fontconfig
Description:
generic font configuration library - support binaries
Submitter:
Christoph Anton Mitterer
Date:
2023-08-20 14:18:02 UTC
Severity:
normal
Tags:
#1028643#5
Date:
2023-01-14 05:56:53 UTC
From:
To:

Hey.

After upgrading from 2.13.1-4.5 to 2.14.1-3 the font rendering looks
noticebly different (and IMO worse).

Attached are some example images (before/after). It's always the same
window (i.e. nothing was closed or so, but aptitude changed a bit
because of the downgrading), just fontconfig was upgraded/downgraded.

AFAICT not only the line spaces are different, but also the font
changed (look at the zeros).


Any ideas?


Cheers,
Chris.

#1028643#10
Date:
2023-01-14 14:19:05 UTC
From:
To:
As far as I can tell, it’s not that the font rendering has changed, but
that the default monospace font has changed (it was previously DejaVu
Mono Book on my system, now it’s Noto Sans Mono; see the output of “fc-
match monospace”).

I don’t know if this change is intended. Note that it in particular it
impacts the default GNOME configuration.

#1028643#15
Date:
2023-01-14 14:54:15 UTC
From:
To:
Hey Sébastien.
$ fc-match
Vera.ttf: "Bitstream Vera Sans" "Roman"

(i.e. not DejaVu).

Ah... I think I just realised that the "Monospace" font, which Cinnamon
shows in it's config as the default font for a monospaced font doesn't
seem to be an actual font, but just some alias or whatever default fc
sets?


Not sure how to best deal with this issue - do you think a NEWS.Debian
entry would be appropriate?
I mean changing that can be quite "annoying" to people, if they're very
used to their font and maybe do not even directly notice what's
different, just that something looks strange ;-)

At least personally, I find the increased line space quite ugly for
terminals, etc..


Cheers,
Chris.

#1028643#26
Date:
2023-01-16 01:21:30 UTC
From:
To:
For anyone who is not super happy with this change from DejaVu to Noto
I just did this to revert it:

1. Create a file called /etc/fonts/conf.d/50-prefer-dejavu.conf
2. Add the following:

<fontconfig>
<alias>
    <family>monospace</family>
    <prefer>
        <family>DejaVu Sans Mono</family>
    </prefer>
</alias>
<alias>
    <family>sans</family>
    <prefer>
        <family>DejaVu Sans Book</family>
    </prefer>
</alias>
<alias>
    <family>serif</family>
    <prefer>
        <family>DejaVu Serif Book</family>
    </prefer>
</alias>
</fontconfig>

3. Save the file and run fc-cache -r

I'm not super familiar with how fontconfig works so if anyone who is
could look over this and suggest a better method it would be greatly
appreciated. But this seems to work if you want the old behaviour
back.

#1028643#31
Date:
2023-01-16 01:50:24 UTC
From:
To:
Just to add as an XFCE user this change greatly impacted the look of
my desktop. So while this may be fine for GNOME users, people with
other DEs could be affected by the change.

I also didn't quite get the file correct to revert the change in my
previous email so here's the updated version, as far as I know this
should work correctly.

<fontconfig>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>DejaVu Sans Mono</family>
        </prefer>
    </alias>
    <alias>
        <family>sans</family>
        <prefer>
            <family>DejaVu Sans</family>
        </prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>DejaVu Sans</family>
        </prefer>
    </alias>
    <alias>
        <family>serif</family>
        <prefer>
            <family>DejaVu Serif</family>
        </prefer>
    </alias>
</fontconfig>

#1028643#36
Date:
2023-01-16 02:41:13 UTC
From:
To:
This is the upstream change in fontconfig that led to this bug report
[1]. I can't find any reason why Noto is now preferred over DejaVu in
the change or issues.

[1] https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/ad70d785974992c569b30108923875e5b5e9dc5e

#1028643#45
Date:
2023-01-19 11:06:08 UTC
From:
To:
In addition to the quite negative changes described by others in this
bug report – which I fully agree with – it also seems that the new
fontconfig version causes a new rendering artifact with emacs running
under XWayland. While text rendering wasn't perfect under XWayland
before either, the weird color artifacts that now show up make things
even worse in my opinion. See attached screenshot.

#1028643#50
Date:
2023-01-20 19:00:30 UTC
From:
To:
Yesterday I noticed a substantial change in the interface fonts for my
whole system, I'm running Testing.  They appear somewhat clearer, but
don't align properly like the old fonts.  I'm using MATE, and it caused
things like titlebars to increase in size.  I had noticed rendering
changes with fontconfig in previous years, but this one seems to be a
lot more than just rendering changes.

#1028643#55
Date:
2023-01-21 09:23:41 UTC
From:
To:
I can confirm that downgrade to package version 2.13.1-4.2 from stable fixes
issues with font selection and color artifacts described above.

#1028643#60
Date:
2023-01-21 10:23:24 UTC
From:
To:
Did you try Konomi's workaround instead of downgrading?  That appears to
fix it for me.

#1028643#67
Date:
2023-01-22 13:03:00 UTC
From:
To:
i can't downgrade - this is the only version available

this fixed the color artifacts for me:

remove /etc/fonts/conf.d/10-sub-pixel-rgb.conf

#1028643#72
Date:
2023-02-13 16:39:46 UTC
From:
To:
This sounds like a different issue as far as I know the font change
shouldn't affect subpixel font rendering. It may be that your screen
isn't an LCD or wants a different order to RGB. I'd consider filing a
different bug report.

#1028643#77
Date:
2023-02-13 16:46:06 UTC
From:
To:
As I kind of rushed the fix for this here is what I am sure should be
the most correct way to fix this issue. If you want to change the
fonts system wide create /etc/fonts/local.conf for your user only
~/.config/fontconfig/fonts.conf and put the following in the file:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd" >
<fontconfig>
    <alias>
        <family>serif</family>
        <prefer>
            <family>DejaVu Serif</family>
        </prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>DejaVu Sans</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>DejaVu Sans Mono</family>
        </prefer>
    </alias>
</fontconfig>

The /etc/fonts/conf.d/50-prefer-dejavu.conf file can be removed as
that's not where the config should be located (best practice as far as
I know is the paths in this post). Sorry for the noise and I hope this
helps everyone affected.

#1028643#82
Date:
2023-08-20 14:07:27 UTC
From:
To:
I think this change:

https://salsa.debian.org/freedesktop-team/fontconfig/-/commit/6fae069d

is relevant to this discussion.