Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jagged font rendering #650

Closed
poperigby opened this issue Dec 31, 2020 · 10 comments
Closed

Jagged font rendering #650

poperigby opened this issue Dec 31, 2020 · 10 comments
Labels
bug Something isn't working not our bug Needs to be fixed upstream or elsewhere

Comments

@poperigby
Copy link

Describe the bug
Text has jagged edges that makes it look like there isn't anti-aliasing.

To Reproduce
Steps to reproduce the behavior:

  1. Open any .epub file in Foliate

Expected behavior
The font is rendered with smooth edges.

Screenshots
image
image

Version:

  • Foliate version: 2.5.0
  • OS/Distribution and version: Arch Linux
  • Desktop environment: SwayWM
  • Installation method: Official Arch Linux repository
@poperigby poperigby added the bug Something isn't working label Dec 31, 2020
@johnfactotum
Copy link
Owner

Does this happen with Epiphany or other WebKitGTK apps?

@FreeFull
Copy link

FreeFull commented Jan 6, 2021

It seems that the jagged fonts happen with the Wayland GDK backend, but not with the X11 backend.

@poperigby
Copy link
Author

Does this happen with Epiphany or other WebKitGTK apps?

Yeah.

It seems that the jagged fonts happen with the Wayland GDK backend, but not with the X11 backend.

Yep, that seems to be the case. Running GDK_BACKEND=x11 foliate doesn't produce the problem.

@zlandau
Copy link

zlandau commented Feb 6, 2021

For what it's worth, you can put the override within the .desktop file. For example:

$ tail -n1 .local/share/applications/com.github.johnfactotum.Foliate.desktop
Exec=env GDK_BACKEND=x11 com.github.johnfactotum.Foliate --library

@louwers
Copy link

louwers commented Apr 19, 2021

Does this happen with Epiphany or other WebKitGTK apps?

Yeah.

It seems that the jagged fonts happen with the Wayland GDK backend, but not with the X11 backend.

Yep, that seems to be the case. Running GDK_BACKEND=x11 foliate doesn't produce the problem.

It does for me.

image

Running GNOME + Wayland.

@johnfactotum johnfactotum added the not our bug Needs to be fixed upstream or elsewhere label Jun 30, 2021
@johnfactotum
Copy link
Owner

Closing as it's not fixable in Foliate and not actionable.

@johnfactotum johnfactotum closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2022
@ducky-fish
Copy link

On the GDK_BACKEND solution not working for me I uninstalled the snap edition and downloaded the .deb from the Foliate github. This solved my rendering issues.

Commenting for those who may encounter a similar issue in the future.

@denisftw
Copy link

denisftw commented Jun 3, 2023

The font issues are so simple and yet, there's so little understanding among most people including the vast majority of developers. So, leaving it here for @johnfactotum and everyone who stumbles upon this.

The first message complains about jagged fonts and says that it "makes it look like there isn't anti-aliasing". There is indeed no anti-aliasing in the screenshot, but jagged fonts have nothing to do with it. The fact of the matter is that @poperigby has anti-aliasing disabled either system-wide or framework-wide either intentionally or unintentionally. If it's disabled, then no application should ever try to override this setting, otherwise it would belong to the rubbish bin, so there's no problem here.

Now, if you enable AA, then you'll still have jagged fonts, but because of the blur introduced by AA, you will not see it. Common sense suggests that looking at blurry text all day long will not be good for your eyesight in the long run, but apparently nobody cares. That's why these bugs are so obscure: most developers and QA engineers have AA enabled and they simply cannot see it.

OK, so what do we see in the screenshot? Actually, what we see is a problem with hinting. It's so happened that the characters currently running the GNOME project, specifically those in charge of cairo, had made the decision to change their approach to hinting in GTK4. You can find a couple of heated threads on GNOME GitLab, but the gist is this: "We decided to change it, if you don't like it, use something else". Currently, there aren't that many apps that already switched to GTK4, so many users with disabled AA don't yet see this problem. And everyone else who have AA enabled will never see it (this is not entirely true: some people might detect bad hinting even with AA enabled but those are very rare).

Essentially, what it means is that GTK4 makes AA blur necessary to hide font imperfections, so any app that uses GTK4 will force the user to either enable AA or uninstall the app. If the user had a strong reason not to enable AA before, it will probably be the latter.

@johnfactotum
Copy link
Owner

These screenshots are from the GTK 3 version.

@filmor
Copy link

filmor commented Jun 4, 2023

Also, I remember seeing the jagged fonts in Flatpak but not on the "native" system. So there's that. The changes in GTK4 are mostly about sub-pixel stuff, which is considered outdated with current high DPI screens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working not our bug Needs to be fixed upstream or elsewhere
Projects
None yet
Development

No branches or pull requests

8 participants