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

Partial fix for #1938, add GDK_DEBUG=gl-no-fractional #4255

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

morgan9e
Copy link
Contributor

@morgan9e morgan9e commented Jan 1, 2025

GSK_RENDERER=opengl does not properly handle fractional scaling and thus we need to set GDK_DEBUG=gl-no-fractional.

Potential fix for #1938

@morgan9e morgan9e changed the title Fix for #1938, add GDK_DEBUG=gl-no-fractional Partial fix for #1938, add GDK_DEBUG=gl-no-fractional Jan 1, 2025
@CnTeng
Copy link

CnTeng commented Jan 1, 2025

It works! Thinks!

@agriffis
Copy link

agriffis commented Jan 1, 2025

This makes a significant difference for me. Kitty is my benchmark, and unpatched ghostty is blurrier (look especially at the vim status line). Your patch makes ghostty the crispest of the three!

This is on Fedora/GNOME/Wayland 3840x2160 with 150% scaling.

kitty

kitty

ghostty unpatched

ghostty-before

ghostty patched

ghostty-after

@agriffis
Copy link

agriffis commented Jan 2, 2025

Just wanted to follow up to acknowledge a drawback of this fix. It seems to result in a quantization that sometimes affects letter shapes. For example "p" might render nicely most of the time, but occasionally the vertical stem is skinnier by a pixel, or maybe the right side of the bowl appears pinched.

IMHO this is objectively better than the previous fuzziness, but it's a matter of opinion whether it's better than kitty. Some people might feel that kitty's rendering still strikes the best balance.

Ideally I think that ghostty would:

  1. fix the blurriness to achieve kitty-like rendering
  2. offer a configuration option to quantize pixels as this patch achieves

so that the two "better" outcomes are both available by user preference. Now that I've used this patch, I might actually stick with it personally, because I really like the crispness even if it sometimes results in a skinny stem.

I would include a screenshot of the oddities, but... every time I engage GNOME's screenshot tool, the oddities go away!

@morgan9e
Copy link
Contributor Author

morgan9e commented Jan 2, 2025

Just wanted to follow up to acknowledge a drawback of this fix. It seems to result in a quantization that sometimes affects letter shapes. For example "p" might render nicely most of the time, but occasionally the vertical stem is skinnier by a pixel, or maybe the right side of the bowl appears pinched.

IMHO this is objectively better than the previous fuzziness, but it's a matter of opinion whether it's better than kitty. Some people might feel that kitty's rendering still strikes the best balance.

Ideally I think that ghostty would:

  1. fix the blurriness to achieve kitty-like rendering

  2. offer a configuration option to quantize pixels as this patch achieves

so that the two "better" outcomes are both available by user preference. Now that I've used this patch, I might actually stick with it personally, because I really like the crispness even if it sometimes results in a skinny stem.

I would include a screenshot of the oddities, but... every time I engage GNOME's screenshot tool, the oddities go away!

Thanks for detailed follow up!
Yeah it still has traditional pixel problem, but I think GTK wont ever be able to fix it.

We dont have that much options unless they add more mature renderer for fractional scaling.. they said newGL would fix it, but obviously it still cant fix it for some cases.

I think there is no answer for this fractional font scaling problem. One say the macOS way is right, other say that way is accurate or this way is more appealing..
Fractional scaling is pain already but with font rendering its much more pain..

@mitchellh mitchellh enabled auto-merge January 2, 2025 23:15
@mitchellh
Copy link
Contributor

Thanks for researching this and thanks to others for confirming this fix. As noted above, even if there is a better long term solution this seems like a strict improvement, so let's go with it. I verified locally (non-fractional) that this doesn't negatively impact anything for me.

@mitchellh mitchellh disabled auto-merge January 2, 2025 23:17
@mitchellh mitchellh enabled auto-merge January 2, 2025 23:17
@mitchellh mitchellh disabled auto-merge January 2, 2025 23:17
@mitchellh mitchellh merged commit 8827b6e into ghostty-org:main Jan 2, 2025
21 checks passed
@github-actions github-actions bot added this to the 1.0.2 milestone Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants