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

Font rendering is different in version 11.1.0-beta1 on Windows #15015

Closed
DavidZidar opened this issue Mar 16, 2024 · 14 comments · Fixed by #15676
Closed

Font rendering is different in version 11.1.0-beta1 on Windows #15015

DavidZidar opened this issue Mar 16, 2024 · 14 comments · Fixed by #15676

Comments

@DavidZidar
Copy link

DavidZidar commented Mar 16, 2024

Describe the bug

I tried updating my application to the beta and noticed that fonts are slightly smaller and blurrier than before.

As there is no mention of this change in the release notes so I wonder if it's intentional or a mistake?

Here's how a section of my app looks with v11.0.10 (nice and clear):
image

And here's what it looks with v11.1.0-beta1 (blurry and too small):
image

To Reproduce

Update to v11.1.0-beta1.

Expected behavior

The font rendering should be like before, or if it's intentional it should be in the release notes and there should be info on how to make adjustments if possible.

Avalonia version

11.1.0-beta1

OS

Windows

Additional context

No response

@timunie
Copy link
Contributor

timunie commented Mar 17, 2024

Please file a minimum sample using your font to double-check on our side

@DavidZidar
Copy link
Author

@timunie It's the default font. But this also happens with a custom font I have so I assume it affects all fonts.

@DavidZidar
Copy link
Author

I reproduced it using dotnet new avalonia.app and then updating to 11.1.0-beta1

With 11.0.10:
image

With 11.1.0-beta1:
image

@Gillibald
Copy link
Contributor

Second image has no ClearType enabled

@DavidZidar
Copy link
Author

Just to be clear, the only change I made was the version number of the Avalonia packages.

@rabbitism
Copy link
Contributor

similar
#14711

@timunie
Copy link
Contributor

timunie commented Mar 18, 2024

Yeah seems to be a duplicate of #14711 .

@Gillibald I'll leave it to you if you want to close that issue in favor of the other one

@DavidZidar
Copy link
Author

Is it actually a duplicate? I opened a separate issue because I am not seeing a difference in the font rendering in the other screenshot, just different boldness. But maybe my eyes are deceiving me.

@Gillibald
Copy link
Contributor

Such issue reports are not helping. I need a minimal repro I can run as is without building some full blown up application.

@rabbitism
Copy link
Contributor

rabbitism commented Mar 18, 2024

https://github.com/rabbitism/FontDiffIssue
https://github.com/rabbitism/AvaloniaIssueRepro/tree/main/FontRenderIssue
Here is the repro, run both projects and compare closely.
5164ccb1a8e8c70c407ba7ddac668a31

@DavidZidar
Copy link
Author

Such issue reports are not helping. I need a minimal repro I can run as is without building some full blown up application.

Your own hello world template reproduces the issue, I don't see the problem.

@maxkatz6
Copy link
Member

Looks like ClearType doesn't work for some reason.

image

@BobbyCannon
Copy link

BobbyCannon commented Apr 26, 2024

Tested with 11.1.0-beta2 in the repo example. It's still fuzzy.

https://github.com/rabbitism/AvaloniaIssueRepro/tree/main/FontRenderIssue

Also it's easy to see if you just open the Avalonio DevTools

image

@grokys
Copy link
Member

grokys commented May 10, 2024

The problem here is related to Skia(Sharp):

This API is required to make sub pixel rendering work with layers: https://api.skia.org/structSkCanvas_1_1SaveLayerRec.html

One can currently set CompositionOptions.UseSaveLayerRootClip = false to disable the extra intermediate layer and get font rendering back to normal - at the expense of some rendering artifacts in some situations.

My feeling is that CompositionOptions.UseSaveLayerRootClip = false should be the default for now, until we can fix the problem at its source.

grokys added a commit that referenced this issue May 10, 2024
By default disable the `UseSaveLayerRootClip` option: this will re-enable subpixel rendering, fixing #15015 but causing #14270 to reappear.

Until the required API is added to SkiaSharp you have to choose one or the other :(
maxkatz6 pushed a commit that referenced this issue May 12, 2024
By default disable the `UseSaveLayerRootClip` option: this will re-enable subpixel rendering, fixing #15015 but causing #14270 to reappear.

Until the required API is added to SkiaSharp you have to choose one or the other :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants