A "Regular" font will have an empty styleName e.g. "DejaVu Sans,12,-1,5,50,0,0,0,0,0"
so that setBold(true) can work; we deliberately clear the styleName for
"Regular"-like font styles when saving via KConfig, see: writeEntryGui()
from kconfiggroupgui.cpp and https://phabricator.kde.org/D27735 for more
gory details.
Change nearestExistingFont() to return the same font it's been called on
if the search result gives us the same font (same weight, same style), and
interpret the case when the styleName is empty to mean it's using a
"Regular"-like style if the font weight is QFont::Normal and the styleName
is "Regular|Normal|Book|Roman".
Due to the change to clear font styleName property when saving viaChange setNearestExistingFonts() to set the fonts only if nearestExistingFont()
returns a different font.
Also remove setNeedsSave(false) from load() method, doesn't seem to be needed
any more (Partially reverting commit 0c4da0774e4388b6937b).
[Fonts KCM] Port KFontDialog/KFontChooser to QFontDialog
QFontDialog doesn't have the capability that KFontDialog had, where with
the latter when using adjustAllFonts() you could change only one of
KConfig (D27735)the font family, the font style, the font size, if in kdegloblase.g. you removed the ",Regular|Normal|Book|Roman"could change
from the end of the *the size and keep each respective font*= entries families for "General" and "Toolbar" as is.
When using ajustAllFonts(), openintry to set the font selection dialogixed width/Monospace font
infrom the KCM, the very first style ifont family the user has selected, not "Regular" and co. asotherwise fallback to whatever
it should be. This will be addressed in an upcoming diff.QFontDatabase::systemFont(QFontDatabase::FixedFont) gets.
Depends on D27785