Bug 384031 - Monitor Scaling / HiDPI support breaks font Anti-Aliasing
Summary: Monitor Scaling / HiDPI support breaks font Anti-Aliasing
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Kubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-26 02:37 UTC by sac
Modified: 2018-03-16 22:27 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Scale 1,5 NOK (228.70 KB, image/png)
2017-08-29 13:49 UTC, sac
Details
Scale 1,5 Login NOK (57.01 KB, image/png)
2017-08-29 13:52 UTC, sac
Details
Scale 1,0 OK (266.22 KB, image/png)
2017-10-17 20:27 UTC, sac
Details
Scale 1,5 NOK Plasma 5.11.90 (73.12 KB, image/png)
2017-10-21 18:08 UTC, sac
Details
2.0 OK Desktop effects (277.86 KB, image/png)
2017-10-22 13:36 UTC, sac
Details
1.5 NOK Desktop effects (213.13 KB, image/png)
2017-10-22 13:37 UTC, sac
Details
env (3.04 KB, text/plain)
2017-10-22 13:37 UTC, sac
Details
Side by side comparism 1,5 & 2,0 (4.04 KB, image/png)
2017-10-24 16:07 UTC, sac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sac 2017-08-26 02:37:56 UTC
If System Settings > Monitor > Scaling is greater than 1 (tested with 1.5 & 2), Anti-Aliasing of fonts breaks in important applications. 

E.g. System Settings > Desktop Effects > Effects is broken: no anti-aliasing in the right content window. Same happens to Okular which can no longer use anti-aliasing for PDFs.

This is just related to the Scaling factor. Just setting fonts DPI forced to 144 alone, is working with anti-aliasing. 

Only the scaling mechanism breaks some stuff here.
Comment 1 sac 2017-08-29 13:49:48 UTC
Created attachment 107577 [details]
Scale 1,5 NOK

Open this image with 100% (original size) and compare the "e" in "Hint: to find out or configure"
Comment 2 sac 2017-08-29 13:52:01 UTC
Created attachment 107578 [details]
Scale 1,5 Login NOK

Open this image with 100% (original size) and compare the "e" in "Hint: to find out or configure"
Comment 3 David Edmundson 2017-08-29 13:53:59 UTC
Fixed in Qt 5.10
Comment 4 sac 2017-10-13 22:37:02 UTC
Sry, but this is not fixed. 

Exactly the same result with Qt 5.10 Beta (tested with KDE Neon devn unstable "deb http://archive.neon.kde.org/testing xenial main"). Same on Qt 5.9.2 (tested with Suse Krypton).

Apart from the ugly fonts in Okular and system settings, all log screen images are not aliased, too (after clicking kde menu->logout images for shutdown, logout, restart are totally ugly).
Comment 5 sac 2017-10-17 20:27:31 UTC
Created attachment 108413 [details]
Scale 1,0 OK
Comment 6 sac 2017-10-21 18:08:01 UTC
Created attachment 108488 [details]
Scale 1,5 NOK Plasma 5.11.90

Even worse in Plasma 5.11.90
Comment 7 Robert Lindgren 2017-10-22 10:25:05 UTC
I have the same problem in KDE Neon.
Comment 8 David Edmundson 2017-10-22 11:12:37 UTC
Okular is unrelated. That's on them to fix.
(which btw, is fixed for next Applications release)

Everything should work fine with 2.0 - please post a screenshot of that and include the output of running "env".

Embedded QtQuick did have an issue with fractional scaling but that should be fixed by dfce0a8feceeb7156eba6ac5d8d3521e3009a583 in QtDeclarative. 

Can you double double check you have Qt 5.10 running please. You can see it in menu -> about system settings -> libraries.
Comment 9 sac 2017-10-22 13:36:50 UTC
Created attachment 108509 [details]
2.0 OK Desktop effects
Comment 10 sac 2017-10-22 13:37:36 UTC
Created attachment 108510 [details]
1.5 NOK Desktop effects
Comment 11 sac 2017-10-22 13:37:53 UTC
Created attachment 108511 [details]
env
Comment 12 sac 2017-10-22 13:42:58 UTC
You're right, tested with "openSUSE_Krypton.x86_64-5.11.90-Build1.44.iso" (QT 5.10, before I just tested with Neon Live and guess that not all was loaded after logging out and back in). 

>(which btw, is fixed for next Applications release)
Yes, fixed in Krypton ;)

>Everything should work fine with 2.0
True, all stuff is fine with 2.0.

Just the login screen & desktop effects has not changed with QT5.10 and is still not aliased ( https://bugs.kde.org/attachment.cgi?id=107578 ) with "about system settings -> libraries" = "build against 5.10.0". Env attached.
With 1.5 broken: https://bugs.kde.org/attachment.cgi?id=108509
With 2.0 it's OK: https://bugs.kde.org/attachment.cgi?id=108510
Comment 13 David Edmundson 2017-10-24 09:40:33 UTC
What's wrong with the 1.5 in that picture?
Comment 14 Robert Lindgren 2017-10-24 10:49:21 UTC
I think the prefix for the images is wrong since the 2.0 is fuzzy in the last example.
Comment 15 David Edmundson 2017-10-24 11:11:59 UTC
It's very interesting that the left sidebar looks ok in that screenshot.
Comment 16 sac 2017-10-24 16:07:15 UTC
Created attachment 108547 [details]
Side by side comparism 1,5 & 2,0

Exactly, the left sidebar is fine, just the right content area is messed up.

BTW: just checked, files are named correctly (as mentioned, they have to be opened in the original size, not zoomed). Attached here is a side-by-side comparism.
Comment 17 Simonas 2017-12-16 23:10:25 UTC
I can confirm the same issue on my dell xps 15 4k, when i set scaling to non integer value (2.2 in my case) i get the same fuzzy looking fonts. Im also running qt 5.10, and it didnt solve any issues.
Comment 18 Nate Graham 2018-03-12 03:49:29 UTC
This is caused by the use of QTQuickControls widgets that use a font rendering style that doesn't support non-integer scale factors. System Settings KCMs are being rewritten (see https://phabricator.kde.org/tag/plasma_kcm_redesign/), which will fix this one KCM at a time. Plasma itself will be fixed with https://phabricator.kde.org/D11244
Comment 19 Nate Graham 2018-03-16 22:27:17 UTC
Git commit a21bc11fe11651f6d211489ebfc8435cef877194 by Nathaniel Graham.
Committed on 16/03/2018 at 22:26.
Pushed by ngraham into branch 'master'.

Fix text scaling with non-integer scale factors when PLASMA_USE_QT_SCALING=1 is set

Summary:
When `PLASMA_USE_QT_SCALING=1` is set, Plasma uses native Qt scaling. This works fine for integer scale factors, and fixes a lot of bugs (see [[https://bugs.kde.org/show_bug.cgi?id=356446|Bug 356446]]) but it introduces a new one: with non-integer scale factors, text becomes blurry and pixellated because of a bug in `Text.NativeRendering`: https://bugreports.qt.io/browse/QTBUG-67007

QQC2-desktop-style forces the use of `Text.QtRendering` rendering for non-integer scale factors, successfully working around the problem. But PlasmaComponents QML objects don't implement the same workaround, so we see the issue in Plasma. This patch fixes that, and gets us one step closer to being able to use Qt scaling in Plasmashell.

There is no effect when `PLASMA_USE_QT_SCALING=1` is not being used.

FIXED-IN 5.13
Related: bug 391691, bug 386216, bug 391695, bug 391694, bug 385547, bug 391692, bug 356446

Test Plan:
Before: `PLASMA_USE_QT_SCALING=1` set, 1.2 scale factor: Plasma text looks awful:
{F5749797}

After: `PLASMA_USE_QT_SCALING=1` set, 1.2 scale factor: Plasma text looks amazing!
{F5749798}

Note that we still get sub-pixel anti-aliasing and good kerning. There appear to be no layout regressions.

Without both `PLASMA_USE_QT_SCALING=1` and a non-integer scale factor set, there is no visual change compared to the status quo.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: mart, broulik, #frameworks

Tags: #frameworks

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

M  +4    -2    examples/applets/testtheme/contents/ui/FontGizmo.qml
M  +5    -1    src/declarativeimports/plasmacomponents/qml/Label.qml
M  +5    -1    src/declarativeimports/plasmacomponents/qml/private/DualStateButton.qml
M  +4    -0    src/declarativeimports/plasmacomponents3/ComboBox.qml
M  +5    -1    src/declarativeimports/plasmacomponents3/Label.qml
M  +5    -1    src/declarativeimports/plasmacomponents3/TextArea.qml
M  +5    -1    src/declarativeimports/plasmacomponents3/TextField.qml
M  +5    -0    src/declarativeimports/plasmastyle/ComboBoxStyle.qml
M  +4    -1    src/declarativeimports/plasmastyle/SpinBoxStyle.qml
M  +4    -1    src/declarativeimports/plasmastyle/TextAreaStyle.qml
M  +4    -1    src/declarativeimports/plasmastyle/TextFieldStyle.qml

https://commits.kde.org/plasma-framework/a21bc11fe11651f6d211489ebfc8435cef877194