mono / SkiaSharp

SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
MIT License
4.17k stars 522 forks source link

[BUG] 2.88.0 and 2.80.4 draw fonts with substantially less resolution than 2.80.3. #2218

Closed janne-hmp closed 1 month ago

janne-hmp commented 1 year ago

Description

The fonts in SkiaSharp 2.88.0 and 2.80.4 are drawn with substantially less resolution than in 2.80.3.

Code

See the screenshots.

Expected Behavior

Fonts are drawn in high resolution similar to 2.80.3.

Actual Behavior

Fonts are drawn with lower resolution than in 2.80.3

Basic Information

Screenshots

Screenshots using 2.88.0, 2.80.4 and 2.80.3. Screenshots with 2.88.0 and 2.80.4 are identical, while 2.80.3 has better font resolution.

Screenshot_20220815-2-80-3 Character selection in 2.80.3 with fonts drawn in high resolution

Screenshot_20220815-2-80-4 Character selection in 2.80.4 with fonts drawn in low resolution

Screenshot_20220815-2-88-0 Character selection in 2.88.0 with fonts drawn in low resolution

Reproduction Link https://github.com/hyvanmielenpelit/GnollHack

janne-hmp commented 1 month ago

Solved by setting SKPaint's IsAntiAliasing = true on 2.88.8 / Xamarin and SKFont's Edging to AntiAlias on 3.00.x / .NET MAUI. Android seems to work in this way by default, but it is probably good form to set the properties accordingly on Android, too.