Commit ce1d3c92 authored by Devin Lin's avatar Devin Lin 🎨
Browse files

Do not set default font style names, and just rely on weights

Setting default font style weights prevents applications from using different font weights. This is also consistent with the fonts kcm, as it sets font weights instead of the style name. See here: https://doc.qt.io/qt-5/qfont.html#setStyleName
parent 30893f8d
......@@ -84,11 +84,8 @@ QFont *KFontSettingsData::font(FontTypes fontType)
//NOTE: We are not using KConfig directly because we can't call QFont::QFont from here
if (!fontInfo.isEmpty()) {
cachedFont->fromString(fontInfo);
} else {
// set the canonical stylename here, where it cannot override
// user-specific font attributes if those do not include a stylename.
cachedFont->setStyleName(QLatin1String(fontData.StyleName));
}
// Don't set default font style names, as it prevents different font weights from being used (the QFont::Normal weight should work)
mFonts[fontType] = cachedFont;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment