Bug 413673

Summary: Previews of fonts settings look horrible if fractional display scaling is used
Product: [Applications] systemsettings Reporter: Patrick Silva <bugseforuns>
Component: kcm_fontsAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: bizyaev, katyaberezyaka, nate, postix, qydwhotmail, unassigned-bugs
Priority: NOR    
Version: 5.24.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.24.6
Bug Depends on:    
Bug Blocks: 356446    
Attachments: preview of sub-pixel rendering
preview of hinting

Description Patrick Silva 2019-10-31 14:58:14 UTC
Created attachment 123621 [details]
preview of sub-pixel rendering

STEPS TO REPRODUCE
1. set display scale factor to 1.2 in system settings > display and monitor > display configuration
2. restart plasma session
3. open system settings > Fonts, open "Sub-pixel rendering" or "Hinting" dropdowns

OBSERVED RESULT
See the attached screenshots.

EXPECTED RESULT
previews of fonts settings look good

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.17.2
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1
Comment 1 Patrick Silva 2019-10-31 14:58:50 UTC
Created attachment 123622 [details]
preview of hinting
Comment 2 Ilya Bizyaev 2021-01-09 15:50:59 UTC
Same here.

Operating System: openSUSE Leap 15.2
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 3 Patrick Silva 2022-02-18 18:19:56 UTC
Operating System: Arch Linux
KDE Plasma Version: 5.24.1
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Graphics Platform: X11
Comment 4 Bug Janitor Service 2022-02-19 03:54:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1472
Comment 5 Fushan Wen 2022-06-03 01:18:50 UTC
I am unable to continue working on the patch. Please feel free to continue the work if anyone has interest.
Comment 6 Fushan Wen 2022-06-20 00:27:31 UTC
Git commit b96d56ae1727ab6de8b40aa787faef90cdd89fb6 by Fushan Wen.
Committed on 20/06/2022 at 00:27.
Pushed by fusionfuture into branch 'master'.

kcms/fonts: Fix font hinting preview

In `combineImages`, the width and the height were calculated
incorrectly. This makes the preview image correctly obey the device
pixel ratio of the primary screen, so the preview image can be clear
and sharp.
FIXED-IN: 5.25.1

M  +30   -13   kcms/fonts/previewimageprovider.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/b96d56ae1727ab6de8b40aa787faef90cdd89fb6
Comment 7 Fushan Wen 2022-06-20 00:28:14 UTC
Git commit e560ea67f0cda92c82774ba776b8c0a72ce4dc43 by Fushan Wen.
Committed on 20/06/2022 at 00:28.
Pushed by fusionfuture into branch 'Plasma/5.25'.

kcms/fonts: Fix font hinting preview

In `combineImages`, the width and the height were calculated
incorrectly. This makes the preview image correctly obey the device
pixel ratio of the primary screen, so the preview image can be clear
and sharp.
FIXED-IN: 5.25.1


(cherry picked from commit b96d56ae1727ab6de8b40aa787faef90cdd89fb6)

M  +30   -13   kcms/fonts/previewimageprovider.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/e560ea67f0cda92c82774ba776b8c0a72ce4dc43
Comment 8 Fushan Wen 2022-06-20 00:34:29 UTC
Git commit 8faab6bc54b6acf38708fd30b66593d3ccaa03be by Fushan Wen.
Committed on 20/06/2022 at 00:33.
Pushed by fusionfuture into branch 'Plasma/5.24'.

kcms/fonts: Fix font hinting preview

In `combineImages`, the width and the height were calculated
incorrectly. This makes the preview image correctly obey the device
pixel ratio of the primary screen, so the preview image can be clear
and sharp.
FIXED-IN: 5.24.6

(cherry picked from commit b96d56ae1727ab6de8b40aa787faef90cdd89fb6)

M  +30   -13   kcms/fonts/previewimageprovider.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/8faab6bc54b6acf38708fd30b66593d3ccaa03be