Hi!

The reason for rounding is that the subpixel position of the glyphs is baked 
into the cached rendering of the glyph itself (so horizontal position x.5 would 
be a different cached object than x.0, but they should both be rendered at 
pixel x). It's a bit complex because the projected positions of the glyphs are 
calculated later, in the vertex shader, so you need to do some precalculation 
to produce something which aligns with the pixel edge when the final scale is 
applied. I believe the reason retina is mentioned there specifically is just 
because it's the first place we supported DPI-scaling, but it's not exclusive 
to Apple anymore.

Which Qt version is in use here? I did fix some bugs related to this, e.g. 
https://codereview.qt-project.org/c/qt/qtdeclarative/+/417675 and 
https://codereview.qt-project.org/c/qt/qtdeclarative/+/376361

Most of my testing was on Windows, though, so it sounds like there could still 
be issues on Wayland.


Eskil Abrahamsen Blomfeldt
Senior Manager, Graphics

The Qt Company
Sandakerveien 116
0484 Oslo, Norway
eskil.abrahamsen-blomfe...@qt.io
http://qt.io

________________________________
From: Development <development-boun...@qt-project.org> on behalf of Kai Uwe 
Broulik <k...@privat.broulik.de>
Sent: Monday, August 28, 2023 6:22 PM
To: development@qt-project.org <development@qt-project.org>
Subject: [Development] QSGText: Why round glyph position like this?

Hi everyone,

while investigating blurry font with native renderer in QML apps in
Plasma 6 under Wayland with fractional scaling (devicePixelRatio 1.75 in
my case), I stumbled upon QSGTextMaskMaterial::populate which rounds the
glyph position [1] citing Mac OS behavior.

When I remove the rounding, font appears rendered correctly on my system
(sorry for attachment ;), but this code hasn’t changed since 2014 and I
am not very knowledgeable in this part of Qt. It’s also flooring the X
and rounding the Y coordinate.

What’s the deal with that? Tor Arne, can you perhaps shed some light on
this?

Cheers
Kai Uwe

[1]
https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp#n455
-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to