CoreText: Add note about why we defer population of theme font descriptors

Pick-to: 6.2 6.3
Change-Id: I7018a92467c6db1b9d04b88e50113ba9c9d1a3b7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
bb10
Tor Arne Vestbø 2022-03-21 14:21:10 +01:00
parent 741a4987b8
commit a068f2d7c9
1 changed files with 6 additions and 0 deletions

View File

@ -764,6 +764,12 @@ void QCoreTextFontDatabase::populateThemeFonts()
FontDescription fd;
getFontDescription(fontDescriptor, &fd);
// We might get here from QFontDatabase::systemFont() or QPlatformTheme::font(),
// before the font database has initialized itself and populated all available
// families. As a result, we can't populate the descriptor at this time, as that
// would result in the font database having > 0 families, which would result in
// skipping the initialization and population of all other font families. Instead
// we store the descriptors for later and populate them during populateFontDatabase().
if (!m_systemFontDescriptors.contains(fontDescriptor))
m_systemFontDescriptors.insert(fontDescriptor);
else