Bug 2012474 - GTK 4 fonts are blurry
Summary: GTK 4 fonts are blurry
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gtk4
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: https://ask.fedoraproject.org/t/commo...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-09 15:01 UTC by Artem
Modified: 2023-04-25 13:29 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-13 15:39:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
GTK4-Fedora (142.23 KB, image/png)
2021-10-09 15:02 UTC, Artem
no flags Details
GTK4-Flathub (100.71 KB, image/png)
2021-10-09 15:03 UTC, Artem
no flags Details
Fedora 36 Beta and Fedora 35 font rendering compared (80.67 KB, image/png)
2022-04-11 14:43 UTC, joshas
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNOME Gitlab GNOME gtk issues 3787 0 None opened Blurry text everywhere in GTK4 2022-04-19 16:52:17 UTC

Description Artem 2021-10-09 15:01:49 UTC
Description of problem:
GTK 4 fonts are blurry in Fedora apps compared to Flathub versions.


Version-Release number of selected component (if applicable):
gtk4-4.4.0-4


How reproducible:
Install any gtk4 app RPM and Flathub version.
For example:
  - Fedora:  dnf install gnome-extensions-app
  - Flathub: flatpak install flathub org.gnome.Extensions


Actual results:
Blurry fonts in Fedora version.


Expected results:
Nicely looking fonts like in Flathub version. Flathub version also look equal to current GTK 3 version.


Additional info:
Demo screenshots attached in next post. Also browser version:
  - Fedora:  https://atim.fedorapeople.org/gtk4-fedora.png
  - Flathub: https://atim.fedorapeople.org/gtk4-flathub.png

Comment 1 Artem 2021-10-09 15:02:25 UTC
Created attachment 1831221 [details]
GTK4-Fedora

Comment 2 Artem 2021-10-09 15:03:38 UTC
Created attachment 1831222 [details]
GTK4-Flathub

Comment 3 joshas 2022-04-11 14:43:33 UTC
Created attachment 1871827 [details]
Fedora 36 Beta and Fedora 35 font rendering compared

Comment 4 joshas 2022-04-11 14:44:16 UTC
Issue is more apparent in Fedora 36 Beta, where more default applications were updated to GTK4. E.g. in this screenshot of Settings, Fedora 36 Beta on the left and Fedora 35 on the right. Subpixel antialiasing (for LCD screens) is enabled using GNOME Tweaks on both versions. Notice, how Fedora 35 fonts are much crisper and have better legibility on standard DPI monitor.

Comment 5 Michael Catanzaro 2022-04-19 17:28:40 UTC
In Fedora 36, many applications have upgraded from GTK 3 to GTK 4. Text rendering in GTK 4 is different from in GTK 3. Notably, GTK 4 uses subpixel positioning, which is intended to improve text clarity and legibility. However, due to an unidentified bug, it currently just makes fonts blurry instead. The developers welcome assistance to identify and correct this issue. In the meantime, you may configure GTK 4 to render text more similarly to GTK 3 by creating a ~/.config/gtk-4.0/settings.ini which contains the following:

```
[Settings]
gtk-hint-font-metrics=1
```

Comment 6 Matthias Clasen 2022-04-20 02:27:50 UTC
Some clarifications, maybe:

Yes, GTK 4 is using subpixel positioning, which is basically incompatible with hinting. I wouldn't say that is intended to improve text clarity and legibility, really. It is intended to provide linear layout and better compatibility between text layout and animation and transformation. And it is _expected_ to make font rendering somewhat blurrier. The current implementation has bugs that make thing more blurry than necessary, some of which _have_ recently been identified and fixed (but not in F36 yet).

Comment 7 Matthias Clasen 2022-04-20 02:29:44 UTC
It is also worth explicitly pointing out that subpixel antialiasing is not a feature that is supported in GTK4 font rendering.

Comment 8 Michael Catanzaro 2022-04-20 03:05:10 UTC
OK, next try at text for CommonBugs. Please review it again to make sure I have this right:


In Fedora 36, many applications have upgraded from GTK 3 to GTK 4. By default, text rendering in GTK 4 uses subpixel positioning, whereas GTK 3 used hinting instead. Subpixel positioning, which is incompatible with hinting, is intended to provide linear layout and better compatibility with animation and transformation. It is also expected to make font rendering somewhat blurrier. While this is an intentional design choice, the current implementation has bugs that make things more blurry than necessary. Some of these bugs have recently been identified and fixed, but the fixes are not available in Fedora 36 as of its release date, and other bugs remain. Assistance to identify and correct remaining bugs is welcome.

If you want, you may configure GTK 4 to render text more similarly to GTK 3 by creating a ~/.config/gtk-4.0/settings.ini which contains the following:

```
[Settings]
gtk-hint-font-metrics=1
```

Subpixel positioning is not to be confused with subpixel antialiasing (rgba antialiasing), both of which are sometimes referred to using the ambiguous term "subpixel rendering." GTK 3 supported subpixel antialiasing, but not by default. GTK 4 does not support subpixel antialiasing.

Comment 9 Matthias Clasen 2022-04-20 11:12:51 UTC
Thanks. Here is my reshuffling of this information. Leaving technical details to the end, and avoiding the call for a bug flood:

----

In Fedora 36, many applications have upgraded from GTK 3 to GTK 4. Font rendering in GTK 4 is different from GTK 3, and is expected to be a bit blurrier. While this is an intentional design choice, the current implementation has bugs that make things more blurry than necessary. Some of these bugs have recently been identified and fixes will be made in Fedora 36 as they become available.

If you want, you may configure GTK 4 to render text more similarly to GTK 3 by creating a ~/.config/gtk-4.0/settings.ini which contains the following:

```
[Settings]
gtk-hint-font-metrics=1
```

In detail, font rendering in GTK 4 uses subpixel positioning to improve linearity of text layout and shape fidelity, which is incomatible with hinting. Subpixel positioning is not to be confused with subpixel antialiasing (rgba antialiasing), both of which are sometimes referred to using the ambiguous term "subpixel rendering." GTK 3 supported subpixel antialiasing, but not by default. GTK 4 does not support subpixel antialiasing.

Comment 10 Kamil Páral 2022-05-04 09:03:28 UTC
Thank you very much for the write-up. I published it here:
https://ask.fedoraproject.org/t/common-issues/21897

Comment 11 Ben Cotton 2022-11-29 17:08:18 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 12 Ben Cotton 2022-12-13 15:39:32 UTC
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13.

Fedora Linux 35 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 13 Luiz Carlos da Silveira Junior 2023-04-25 13:29:39 UTC
In Fedora 38 the gnome-text-editor fonts are too blurry. And gtk-hint-font-metrics=1 didn't work.

I also think gnome-terminal is too blurry.


Note You need to log in before you can comment on or make changes to this bug.