Bug 443216

Summary: Widgets and spacing doesn't scale when custom fonts are set
Product: [Plasma] plasmashell Reporter: strangequark <random1123581321>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.22.4   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Notice the pinned calendar widget
The text in the Applications tab in Kickoff gets truncated when this happens

Description strangequark 2021-10-02 07:04:09 UTC
Created attachment 142077 [details]
Notice the pinned calendar widget

SUMMARY
The Kickoff launcher, among other widgets, doesn't scale when there's a custom font set. This also occurs in the System Settings page, with the sidebar displaying the categories of settings.

STEPS TO REPRODUCE
1. Apply a global scale
2. Keep in mind the size of widgets
3. Apply a different font (System Settings > Appearance > Fonts) for General

OBSERVED RESULT
Many widgets no longer obey scaling. Only the fonts and the icons remain same, but everything shrinks (ie becomes less padded)

EXPECTED RESULT
Should stay the same size

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.22
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-36-generic (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
I'm not personally complaining, because the size I want my applets is as small as possible. But this is a visual bug, whether I like it or not.
Comment 1 strangequark 2021-10-02 07:07:47 UTC
Created attachment 142078 [details]
The text in the Applications tab in Kickoff gets truncated when this happens
Comment 2 Nate Graham 2021-10-05 00:05:23 UTC
Widgets do indeed scale. Everything is drawn using standard values which get scaled by the metrics of the active font. I use 11pt Noto Sans myself (which is about 22% bigger than 10pt Noto Sans) and indeed, everything is about 22% bigger as a result. Of course this depends on the font's metrics being correct... What did you change the font to?
Comment 3 strangequark 2021-10-05 03:28:31 UTC
(In reply to Nate Graham from comment #2)
> Widgets do indeed scale. Everything is drawn using standard values which get
> scaled by the metrics of the active font. I use 11pt Noto Sans myself (which
> is about 22% bigger than 10pt Noto Sans) and indeed, everything is about 22%
> bigger as a result. Of course this depends on the font's metrics being
> correct... What did you change the font to?

In the video, I changed the 'General' font to Ubuntu, keeping the size as default (10px), and the widget that I had pinned shrunk by approximately 1/5th.
Trying other fonts indicates that the widget is actually scaling like it's supposed to, but shouldn't it be the same size if the font px is the same? I'm not sure it's supposed to shrink this much, given the text (as in the picture of Kickoff attached) gets truncated in some places.
Comment 4 Nate Graham 2021-10-05 03:31:32 UTC
Ah yes, I remember that issue. I used to use Ubuntu fonts myself but ran into this. Ubuntu font has extremely small metrics, which is the cause of the issue you're seeing. And the physical size is a bit smaller too; there's no ironclad law that says that 10pt in one font is the same size as 10pt of another font. If you want to use Ubuntu, I would recommend increasing the size to 11pt.
Comment 5 strangequark 2021-10-05 03:37:36 UTC
Ok, thank you!