Skip to content

Fix default fonts (when no font is set in fonts kcm) from not allowing different font weights to be used in Qt applications

Devin Lin requested to merge work/espidev/allow-other-font-weights into master

Currently, when there is no font saved in kdeglobals (from the fonts kcm), the default font provided by plasma-integration sets a style name ("Regular") that ignores any font weights (see https://doc.qt.io/qt-5/qfont.html#setStyleName). This causes Qt applications to have their font weight settings ignored.

Remove the default font style name setting, and instead rely on the font weight value.

Also adjust the default font weight to actually be in line with QFont constants (use QFont::Normal = 50, instead of -1).

The Fonts KCM seems to already be interpreting style names into weights and saving it into kdeglobals, and so that is why after setting the font in the kcm to Noto Sans Regular, different font weights work in Qt applications.

Merge request reports