Fix registration of system default font
QPlatformFontDatabase::resolveFontFamilyAlias returns the input unchanged if the font-name is not found. This means we never register the system default font when it is only a virtual font name. Task-number: QTBUG-58225 Change-Id: Ib4f80bb758aa66a163d223573bfe624bb3c134ab Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
88932d4339
commit
1e7ce7aab0
@ -1191,7 +1191,7 @@ void QWindowsFontDatabase::populateFontDatabase()
|
||||
ReleaseDC(0, dummy);
|
||||
// Work around EnumFontFamiliesEx() not listing the system font.
|
||||
QString systemDefaultFamily = QWindowsFontDatabase::systemDefaultFont().family();
|
||||
if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily).isEmpty())
|
||||
if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily) == systemDefaultFamily)
|
||||
QPlatformFontDatabase::registerFontFamily(systemDefaultFamily);
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ void QWindowsFontDatabaseFT::populateFontDatabase()
|
||||
ReleaseDC(0, dummy);
|
||||
// Work around EnumFontFamiliesEx() not listing the system font
|
||||
QString systemDefaultFamily = QWindowsFontDatabase::systemDefaultFont().family();
|
||||
if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily).isEmpty())
|
||||
if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily) == systemDefaultFamily)
|
||||
QPlatformFontDatabase::registerFontFamily(systemDefaultFamily);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user