slint icon indicating copy to clipboard operation
slint copied to clipboard

slint font rendering is very poor, how to solve it

Open Suhua-OB opened this issue 1 year ago • 2 comments

See the picture below image

Suhua-OB avatar Sep 28 '24 08:09 Suhua-OB

Do you know what renderer/backend you are using? There are some differences between skia and femtovg. I think skia is used in the live preview, while femtovg is the default in a rust application unless you enable skia with a feature flag.

ogoffart avatar Oct 01 '24 06:10 ogoffart

Not OP, but I ran into the same issue and changing to the skia renderer seems to resolve it for me. The font rasterization in the default renderer and default text family (for Windows 11 environment at least) seems to be impressively bad right now. For reproduction I was using English characters at font sizes 20px and 24px, both bold and regular, with a Rust backend. Build and run in release mode and you should notice it right away.

It might be a bug in the renderer rather than Slint itself, but I suggest that what Slint picks as the default renderer should probably be biased towards something that visually looks decent. New users aren't likely to dig into details of how to make things better if their initial testing has pretty poor results. That said your team might have other concerns I'm not aware of that make the current default choice the better tradeoff, so feel free to ignore me on that.

nproux avatar Oct 02 '24 21:10 nproux

Any progress on the font quality? Text layout and font rendering in the examples is extremely poor. Tested on Win10 1920x1200 100% text scaling

  1. uneven horizontal spacing between glyphs (see "consetetur"):

image

or even worse

image

  1. incomplete glyphs (see "Item 1.3")

image

  1. broken vertical placement of glyphs (see "0 Moves 15 Tiles left" message)

image

mackrol avatar Nov 02 '24 18:11 mackrol

@mackrol: Did you try the skia renderer? It tends to render a bit nicer for me, but unfortunately is more error-prone to build, too :-/

hunger avatar Nov 06 '24 11:11 hunger

This is a known issue, the quality of the built-in femtovg glyph rasterization using its own path renderer has seen frequent complaints. AFAICS everyone in the Rust ecosystem is using swash nowadays (bevy via cosmic-text, vello, etc.), and I'd like to move femtovg over to that, as well.

tronical avatar Dec 02 '24 14:12 tronical

Duplicate of #3742

tronical avatar Dec 02 '24 14:12 tronical