Bug 376630 - Bold font rendering is broken after changing font via kcm_fonts
Summary: Bold font rendering is broken after changing font via kcm_fonts
Status: RESOLVED DUPLICATE of bug 378523
Alias: None
Product: plasma-integration
Classification: Plasma
Component: general (show other bugs)
Version: 5.9.2
Platform: ROSA RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Martin Flöser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-18 19:04 UTC by Pulfer
Modified: 2018-04-16 13:08 UTC (History)
6 users (show)

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


Attachments
KDE 4 vs Plasma 5 bold font in Dolphin (176.02 KB, image/png)
2017-02-18 19:04 UTC, Pulfer
Details
Ignore font style when reading config (625 bytes, patch)
2017-02-20 18:09 UTC, Pulfer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pulfer 2017-02-18 19:04:36 UTC
Created attachment 104102 [details]
KDE 4 vs Plasma 5 bold font in Dolphin

Since some time kcm_fonts writes "font=Liberation Sans,10,-1,5,50,0,0,0,0,0, Regular" instead of "font=Liberation Sans,10,-1,5,50,0,0,0,0,0" to kdeglobals. So it breaks bold font rendering in System Settings, Dolphin url bar and some other places. The font is bold but gets a kind of blur. Removing ", Regular" from kdeglobals fixes font rendering.

See the attached screenshot for System Settings (guest) and Dolphin/KF5 (guest) VS Dolphin/KDE4 (host) font rendering comparison.

Maybe QFont() return format changed in Qt 5.7 or 5.8, that's why extra "Regular" is added to font settings. Just my quick guess.
Comment 2 Pulfer 2017-02-19 17:21:42 UTC
Related bug: https://bugs.kde.org/show_bug.cgi?id=348066

Maybe it makes sense to drop only some style names from QFont save string. Like Regular, Bold and Italic. Just because they are already covered by numeric values.
Comment 3 Pulfer 2017-02-20 18:09:56 UTC
Created attachment 104131 [details]
Ignore font style when reading config

The patch restores old behaviour. But it's more like a hack so I don't submit it for review. Old behaviour was buggy in another way, see https://bugs.kde.org/show_bug.cgi?id=348066
Comment 4 Pulfer 2017-02-23 01:34:02 UTC
(In reply to Pulfer from comment #2)
> Maybe it makes sense to drop only some style names from QFont save string.
> Like Regular, Bold and Italic. Just because they are already covered by
> numeric values.

On the other hand, fonts like Arial save localized style name ("Обычный" instead of "Regular"). And switching to Medium style (see #348066) for Ubuntu font likely will break bold font rendering anyway in many applications. So either font style should be ignored or all Qt/KDE applications should be fixed handle it properly.
Comment 5 Ian Schwarz 2017-05-04 14:11:18 UTC
I can confirm this bug and the solution mentioned in comment #0.

QFont::toString() did indeed change from 5.7.0 to 5.8.0 ([QTBUG-54936]):
http://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.8.0/?h=v5.8.0
https://bugreports.qt.io/browse/QTBUG-54936

I have described my struggles with this bug in this forum thread:
https://forums.opensuse.org/showthread.php/524628-Weird-font-problem-No-bold-for-you-(kwin-konsole)
Comment 6 Martin van Es 2017-10-23 11:03:29 UTC
For some reason this is broken on Artful using libfreetype 2.8.1 (updated due to other hinting bug in 2.8.0) and Qt 5.9.1. Removing ",Regular" from font config in kdeglobals and Trolltech.conf resolved all my problems.
Comment 7 Christoph Feck 2017-10-23 11:29:21 UTC

*** This bug has been marked as a duplicate of bug 378523 ***