Bug 366451

Summary: "display scaling" on hidpi screen results in poor font quality
Product: [Plasma] plasmashell Reporter: Lukas Schneiderbauer <lukas.schneiderbauer>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: normal CC: adonai, bhush94, bo, e.ekmecic, fabian, james, nate, nw9165-jjnfov5mav, plasma-bugs, simonandric5, subdiff
Priority: NOR    
Version: 5.7.3   
Target Milestone: 1.0   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: "desktop effects" dialog screenshot
screenshot of "systemsettings"
"desktop effects" dialog screenshot
screenshot of "systemsettings"
logout overlay; scaling=1.5

Description Lukas Schneiderbauer 2016-08-05 16:03:52 UTC
Setting "Scale Display" in the "Display Configuration" to 1.8 results in poor font qualities. This is in general not reproducable and seems to be random.
An exception is the "Desktop Effects" section in "systemsettings", where the poor font is always there, see the soon to be attached screenshot.

Reproducible: Always

Steps to Reproduce:
1. set "Scale Display" factor to 1.8
2. go to "Desktop Effects" section in "systemsettings"
3. look at the font of the effect titles

Actual Results:  
poor font quality

Expected Results:  
super sharp fonts

using Gentoo,
Plasma 5.7.3
KF  5.24.0
QT 5.6.1
Comment 1 Lukas Schneiderbauer 2016-08-05 16:05:57 UTC
Created attachment 100465 [details]
"desktop effects" dialog screenshot

Note that on this picture the left bar also has ugly fonts, but this seems to be an artifact of the screenshot.
Comment 2 Lukas Schneiderbauer 2016-08-05 16:08:20 UTC
Created attachment 100466 [details]
screenshot of "systemsettings"

This screenshot is actually not really representive.
Only the hovered icon has an ugly underlying font in reality. The rest is an artifact of the bad screenshot quality.
Comment 3 Lukas Schneiderbauer 2016-08-05 16:10:09 UTC
Created attachment 100467 [details]
"desktop effects" dialog screenshot

sorry, picked wrong screenshot
Comment 4 Lukas Schneiderbauer 2016-08-05 16:11:13 UTC
Created attachment 100468 [details]
screenshot of "systemsettings"

sorry, picked wrong screenshot
Comment 5 Roman Gilg 2016-10-23 11:12:29 UTC
Still relevant in 5.8.x? How does your shutdown overlay look? How Discover?
Comment 6 Lukas Schneiderbauer 2016-10-23 11:25:16 UTC
Yes, still relevant.
The fonts in the shutdown overlay and in discover look crappy as well (like in my screenshots).
Comment 7 David Edmundson 2016-10-24 09:44:56 UTC
Non integer numbers such as 2 or 3, will produce artifacts.
Comment 8 Roman Gilg 2016-10-24 14:24:16 UTC
Yes, you're right. But it's more: Certain elements (I assume everything directly connected to the plasmashell or the theme) will not scale at all.

Try it out by setting the scale factor first to '2' -> Everything works fine.

Then set it to '1.9' -> artifacts + taskbar, window decorations and launcher and icons in applications not scaled.
Comment 9 David Edmundson 2016-10-25 20:55:33 UTC
Git commit c203e366c400bab750e0b0f3d640f7fa85c35065 by David Edmundson.
Committed on 25/10/2016 at 20:55.
Pushed by davidedmundson into branch 'master'.

Support non integer scale factors in kiconengine

REVIEW: 129253

M  +5    -1    src/kiconengine.cpp

http://commits.kde.org/kiconthemes/c203e366c400bab750e0b0f3d640f7fa85c35065
Comment 10 David Edmundson 2016-10-25 20:58:58 UTC
Git commit 9f6b69237c299cabff1427da54768624545e1943 by David Edmundson.
Committed on 25/10/2016 at 20:58.
Pushed by davidedmundson into branch 'master'.

Support non integer scale factors in KFileDelegate

REVIEW: 129252

M  +7    -1    src/widgets/kfileitemdelegate.cpp

http://commits.kde.org/kio/9f6b69237c299cabff1427da54768624545e1943
Comment 11 Bo Simonsen 2016-10-26 12:28:18 UTC
The infocenter seems also to be affected by this bug:
https://bugzilla.opensuse.org/show_bug.cgi?id=1006651
Comment 12 David Edmundson 2016-11-22 10:32:58 UTC
Git commit 4b2abc581c6b3e7a4c2f1f893d47fad5d3806aca by David Edmundson.
Committed on 22/11/2016 at 10:32.
Pushed by davidedmundson into branch 'Plasma/5.8'.

Disable Qt's high DPI scaling on shutdown/switch user dialogs

Summary:
They use Plasma's scaling, so in theory it should have absolutely no
effect.

In practice it has an effect of hitting a Qt bug with font rendering.

Test Plan: None done

Reviewers: #plasma, mart

Reviewed By: mart

Subscribers: plasma-devel

Tags: #plasma

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

M  +1    -0    ksmserver/main.cpp

http://commits.kde.org/plasma-workspace/4b2abc581c6b3e7a4c2f1f893d47fad5d3806aca
Comment 13 NW 2017-02-04 14:24:37 UTC
Any update on this one?

Things like the shutdown overlay for example still look messed up with display scaling in KDE Neon 5.9.0.
Comment 14 Roman Gilg 2017-02-07 13:29:18 UTC
For me only scaling factors 1.5 and 2 work without problems. Did you try one of these?
Comment 15 NW 2017-02-07 17:49:12 UTC
Yes, I've tried 1.5, same issue.
Comment 16 e.ekmecic 2017-04-21 14:12:56 UTC
I've found that setting XServer DPI manually fixes these fractional scaling problems.
On my 2560x1440 display I use a DPI of 144 (i.e. a scaling factor of 1.5x), which caused problems in regular Qt programs, the lockscreen, shutdown/logout/suspend dialog, Okular etc.

To fix this, added "-dpi 144" to ServerArguments in my sddm.conf and set display scaling back to 1.0x.
This makes KDE and all Qt programs scale flawlessly but GTK programs (i.e. Firefox) remain unscaled which is an acceptable tradeoff for me.

I apologize if I'm spamming the mailing lists as I've been reposting this on all of the bugs I've been tracking related to this issue.
Comment 17 . 2017-05-14 16:45:41 UTC
Created attachment 105535 [details]
logout overlay; scaling=1.5
Comment 18 David Edmundson 2017-08-09 21:50:22 UTC
Fractional scaling on QtQuick views has been improved for Qt 5.10.

Please report if you have any issues after that.
Comment 19 Bo Simonsen 2018-07-09 19:14:08 UTC
This is only partly resolved.

The labels are blurry because 

In QtQuick/Controls/Label.qml (qtquick controls 1):

renderType: Settings.isMobile ? Text.QtRendering : Text.NativeRendering

Needs to be:

renderType: Settings.isMobile || Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering

Following:

https://cgit.kde.org/plasma-framework.git/commit/?id=a21bc11fe11651f6d211489ebfc8435cef877194

This probably means all KDE components should use PlasmaComponents.Label (import org.kde.plasma.components 2.0 as PlasmaComponents)
Comment 20 David Edmundson 2018-07-10 09:25:10 UTC
That's a workaround.

It is fixed in Qt 5.11 with native rendering 

Worth porting code from Qqc1 to qqc2 as we're doing it anyway. But that only fixes the issue by chance
Comment 21 Vlad Zahorodnii 2018-08-15 09:05:04 UTC
Git commit 22d898399b38cadfd72474a2b50f1d41db7bd28e by Vlad Zagorodniy, on behalf of Bo Simonsen.
Committed on 15/08/2018 at 08:31.
Pushed by vladz into branch 'Plasma/5.12'.

[kcmkwin] Use QtQuick.Controls 2.0 for Label and TextField

Summary:
Using QtQuick.Controls for Label and TextField can result in blurry font rendering for a fractional scaling (e.g. 1,5). There is a work around for QtQuick.Controls 2.x therefore using QtQuick.Controls 2.0 for Label and TextField resolves the problem

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: ngraham, zzag, davidedmundson, kwin

Tags: #kwin

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

M  +6    -5    kcmkwin/kwincompositing/qml/Effect.qml
M  +5    -4    kcmkwin/kwincompositing/qml/EffectView.qml
M  +5    -4    kcmkwin/kwindecoration/qml/Buttons.qml

https://commits.kde.org/kwin/22d898399b38cadfd72474a2b50f1d41db7bd28e
Comment 22 Nate Graham 2018-09-21 15:12:54 UTC
Git commit fde8d23beeae5d83af3b4384c96e1da8e27a701e by Nathaniel Graham, on behalf of Bo Simonsen.
Committed on 21/09/2018 at 15:12.
Pushed by ngraham into branch 'Plasma/5.14'.

Use QtQuick.Controls 2.0 Label in energy and fileindexmonitor KCM

Summary:
The QtQuick.Controls 1.0 does not handle Label well on screens that uses a fractional scaling. The fonts become
blurry, this has been fixed in  QtQuick.Controls 2.0 and org.kde.plasma.components, however we prefer to use QtQuick.Controls 2.0 since the modules will anyway transition to 2.x at some time.

Test Plan: * Use scaling 1,5 and fonts will appear correctly in kcm_energyinfo and kcm_fileindexmonitor

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: zzag, davidedmundson, ngraham, broulik, plasma-devel

Tags: #plasma

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

M  +5    -4    Modules/energy/package/contents/ui/main.qml
M  +5    -4    Modules/fileindexermonitor/package/contents/ui/main.qml

https://commits.kde.org/kinfocenter/fde8d23beeae5d83af3b4384c96e1da8e27a701e