Bug 461483 - Layout of the network speed graph is broken when non-default fonts and full font hinting are used
Summary: Layout of the network speed graph is broken when non-default fonts and full f...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Networks widget (show other bugs)
Version: master
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-06 04:08 UTC by Patrick Silva
Modified: 2024-12-23 18:25 UTC (History)
4 users (show)

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


Attachments
screenshot (51.52 KB, image/png)
2022-11-06 04:08 UTC, Patrick Silva
Details
SF Pro Display fonts (883.24 KB, application/zip)
2022-11-06 12:21 UTC, Patrick Silva
Details
full font hinting (209.35 KB, image/png)
2023-11-30 12:49 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2022-11-06 04:08:03 UTC
Created attachment 153511 [details]
screenshot

Title says it all. Please see the attached screenshot.

EXPECTED RESULT
the bug seen in the attached screenshot should not occur

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.2
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7
Graphics Platform: Wayland
Comment 1 Patrick Silva 2022-11-06 12:21:05 UTC
Created attachment 153521 [details]
SF Pro Display fonts

This bug does not occur when I use Noto fonts, it does when I use the attached SF Pro Display fonts.
Comment 2 ratijas 2023-11-19 22:57:48 UTC
Can not reproduce on Plasma 6 with any of the SF Pro Display font. However I was able to reproduce it on Plasma 5.27 by setting "Small:" font in Fonts KCM.

With that said, I think we used to have some issues with TextMetrics in Qt 5 times which have been fixed for Qt 6. The chart component itself also had quite few porting changes during last year. Not sure whom to attribute this fix.
Comment 3 Patrick Silva 2023-11-30 12:49:20 UTC
Created attachment 163649 [details]
full font hinting

It's still reproducible with sf display pro fonts if font hinting is set to Full. Please see the attached screenshot.

Operating System: Arch Linux 
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1
Graphics Platform: Wayland
Comment 4 ratijas 2023-11-30 19:27:33 UTC
Can confirm, full hinting somehow breaks it.
Comment 5 Bug Janitor Service 2023-12-01 01:35:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-nm/-/merge_requests/310
Comment 6 ratijas 2023-12-01 17:22:15 UTC
Git commit 275eacf2088e84d5d4d70531a976ea3d807b0ebd by ivan tkachenko.
Committed on 01/12/2023 at 17:57.
Pushed by ratijas into branch 'master'.

applet: Fix layout of the network speed graph with certain font preferences

TextMetrics uses a different text rendering backend by default, which
has led to inaccurate estimation of the width of AxisLabels. By default
TextMetrics uses QtRendering type; but our Label uses NativeRendering.
In past we used to override renderType with a conditional expression,
so considering such history, hardcoding any type seems inappropriate.
That's why we need an actual instance of Label to fetch a correct
render type at runtime.

Second part of the issue was that instead of width property the layout
should have used advanceWidth, and ceil() it, just in case. But with a
port to Label instance it doesn't matter anymore.

M  +9    -6    applet/contents/ui/TrafficMonitor.qml

https://invent.kde.org/plasma/plasma-nm/-/commit/275eacf2088e84d5d4d70531a976ea3d807b0ebd
Comment 7 Ben Cooksley 2024-12-23 18:25:53 UTC
Bulk transfer as requested in T17796