From 21a28a40478350820901756432d48e74676855cf Mon Sep 17 00:00:00 2001 From: RoflCopter4 Date: Sun, 25 Aug 2019 16:39:26 -0600 Subject: [PATCH] Clear font style name for new fonts The KDE/Plasma theme plugin (or others) may set the font styleName for a new font. However we want to match the family name with the bold/italic attributes instead of the stylename. See #575 --- src/gui/shellwidget/shellwidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/shellwidget/shellwidget.cpp b/src/gui/shellwidget/shellwidget.cpp index 4e4028071..e5a283e4a 100644 --- a/src/gui/shellwidget/shellwidget.cpp +++ b/src/gui/shellwidget/shellwidget.cpp @@ -40,6 +40,10 @@ void ShellWidget::setDefaultFont() bool ShellWidget::setShellFont(const QString& family, qreal ptSize, int weight, bool italic, bool force) { QFont f(family, -1, weight, italic); + // Issue #575: Clear style name. The KDE/Plasma theme plugin may set this + // but we want to match the family name with the bold/italic attributes. + f.setStyleName(QStringLiteral("")); + f.setPointSizeF(ptSize); f.setStyleHint(QFont::TypeWriter, QFont::StyleStrategy(QFont::PreferDefault | QFont::ForceIntegerMetrics)); f.setFixedPitch(true);