Bug 476619

Summary: If custom font is used, font weight is wrong when carrying over settings from Plasma 5
Product: [Plasma] plasmashell Reporter: Akseli Lahtinen <akselmo>
Component: Digital Clock widgetAssignee: Akseli Lahtinen <akselmo>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nate
Priority: NOR Keywords: qt6
Version First Reported In: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Akseli Lahtinen 2023-11-06 10:33:20 UTC
SUMMARY
If user sets a custom font for the Digital Clock widget, the font weight does not carry over from Plasma 5.
For example, I have Inter font for my Digital Clock widget with font weight "Regular" in Plasma 5.
Using Plasma 6 through kdesrc-build and logging in, the font weight had changed to "Thin"

Changing font settings seemed to fix the issue.

STEPS TO REPRODUCE
1. Change digital clock font to something custom in Plasma 5
2. Log in to Plasma 6

OBSERVED RESULT
Digital clock font weight may not be the same as in Plasma 5.

EXPECTED RESULT
Digital clock font weight would carry over.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.5.2
Kernel Version: 6.2.9-300.fc38.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Comment 1 Kai Uwe Broulik 2023-11-06 10:34:32 UTC
Yeah, the Font::Weight changed between Qt 5 and Qt 6. In Qt 5 it is 0..100 with 50 being "Normal". In Qt 6 it follows OpenType with 0..1000 where 400 is "Normal".
Comment 2 Akseli Lahtinen 2023-11-16 13:11:35 UTC
At least for digital clock, this should be fixed now with: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1798

Note for devs/testers: if you jump between Plasma 5 and 6 a lot, the font will look weird again, since the script is only ran once when updating. For regular user, who is just updating from 5 to 6 once, this fixes the issue.

Also, the script in MR can be updated with more widgets if there are other font weight issues in other widgets.