Bug 391780 - Qt text rendering is always being used, leading to text looking a little lighter than necessary
Summary: Qt text rendering is always being used, leading to text looking a little ligh...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-qqc2-desktop-style
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-12 20:27 UTC by Nate Graham
Modified: 2018-04-05 16:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.45


Attachments
top Qt rendering; bottom Native rendering (26.49 KB, image/jpeg)
2018-03-12 20:27 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2018-03-12 20:27:43 UTC
Created attachment 111351 [details]
top Qt rendering; bottom Native rendering

https://cgit.kde.org/qqc2-desktop-style.git/tree/org.kde.desktop/Label.qml#n36

renderType: Window.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering

However, Window.devicePixelRatio doesn't exist (it would be in the Screen import, not Window), so the conditional always evaluates to true, so we always get QtRendering, even at integer scale factors and non-HiDPI. This is what we want for a non-integer scale factor since the alternative is even worse (see https://bugreports.qt.io/browse/QTBUG-67007), but for non-hi-dpi and integer scale factors, we should not use QtRendering, since it results in text that is ever-so-slightly lighter and wispier, which some very sensitive people can pick up on. See the attached comparison: the string on the top was rendered with QtRendering, and the one on the bottom with NativeRendering. Note how the QtRendering version is slightly lighter.

I plan to submit a patch later today if nobody else beats me to it first.
Comment 1 Nate Graham 2018-03-13 02:44:59 UTC
Submitted the patch: https://phabricator.kde.org/D11244
Comment 2 Nate Graham 2018-03-13 02:46:28 UTC
Oops, wrong patch. That one is for Plasma. The QQC2 patch is https://phabricator.kde.org/D11274
Comment 3 Nate Graham 2018-03-13 13:39:17 UTC
Git commit 9a5f7d834f86f57e88c3993fbcf4c17d09a01e10 by Nathaniel Graham.
Committed on 13/03/2018 at 13:39.
Pushed by ngraham into branch 'master'.

Fix font rendering for non-HiDPI and integer scale factors

Summary:
QQC2-desktop-style was attempting to force the use of `Text.QtRendering` for non-integer scale factors. However, it was accidentally using it everywhere. This patch resolves the issue, and makes it use `Text.QtRendering` only for non-integer scale factors.
FIXED-IN: 5.45

Test Plan:
No visual changes when there is a non-integer scale factor.

System Settings before, no scale factor:
{F5751414}

System Settings after, no scale factor:
{F5751415}

Discover before, no scale factor:
{F5751416}

Discover after, no scale factor:
{F5751418}

To notice the differences, you will probably have to open them in different tabs, zoom in with {key Meta +}, and switch between the tabs.

Reviewers: mart, davidedmundson, broulik

Reviewed By: mart, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11274

M  +4    -1    org.kde.desktop/ComboBox.qml
M  +4    -2    org.kde.desktop/Label.qml
M  +4    -2    org.kde.desktop/TextArea.qml
M  +4    -2    org.kde.desktop/TextField.qml

https://commits.kde.org/qqc2-desktop-style/9a5f7d834f86f57e88c3993fbcf4c17d09a01e10