slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.53k stars 600 forks source link

Text rendering regression with femtovg renderer #6215

Open bjorn opened 1 month ago

bjorn commented 1 month ago

While testing the current git master for the upcoming Slint 1.8 release, I noticed that the fonts look jagged. I started going back to older Slint versions until I arrived at Slint 1.4.1, which is the last version where fonts looked good (so it appears to be a regression in Slint 1.5.0).

Slint 1.4.1 (slightly blurry but smooth fonts):

image

Slint 1.5.0 to current git (fonts look jagged):

image

(notice how the right leg of the "n" is one pixel further down than the left leg)

I'm on Linux (Fedora), using the winit backend with the femtovg renderer.

bjorn commented 1 month ago

Just tested this with the todo example. I see it there as well when using renderer-femtovg. I also tested renderer-software, and then the fonts look fine.

renderer-femtovg (git):

image

renderer-software (git):

image

renderer-femtovg (1.4.1):

image

Enyium commented 1 month ago

(notice how the right leg of the "n" is one pixel further down than the left leg)

You seem to mean the n of "Transactions".

This is a screenshot of SlintPad (v1.7.2, using FemtoVG):

T-with-imperfect-vertical-bar

I find it very strange that the bars of the Ts that should be vertical aren't always perfectly vertical. This rendering issue depends on the font size, the preview box size etc.

tronical commented 1 month ago

This is likely a consequence of https://github.com/slint-ui/slint/issues/5177 . Perhaps additional alignment is needed.