slint-ui / slint

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

Fonts (on Windows?) are blurry #1362

Closed megahomyak closed 1 year ago

megahomyak commented 2 years ago

Compare the window title and the window contents on the image below. The window title is much sharper than any of the texts in the window. Blurry font demonstration

It can be replicated with any font size and any text-containing element. I have a 1920x1080 display, the OS is Windows 10 and the scaling factor is 1.25 (texts still remain blurry when switching to 1.00). That's the setting I'm talking about: Windows scaling factor

I am using slint v. 0.2.4

cppdev123 commented 2 years ago

same for me https://github.com/slint-ui/slint/issues/1313

tronical commented 2 years ago

With the GL backend text is indeed not rendered by Window's own rasteriser but using femtovg. This will always look slightly different. In the context of femtovg we've been discussing plugging in custom rasterisers, and so eventually support for windows native text rendering could be added as a setting perhaps.

Another way to avoid this issue is to use the Slint's Qt backend.

tronical commented 1 year ago

The availability of using Skia as renderer solves this issues. You can for example enable it at compile-time via the renderer-winit-skia feature and select it at run-time using SLINT_BACKEND=Skia. Similarly, there's a CMake feature for enabling the Skia renderer.