CoreText: Handle failure to find matching theme font descriptors
CTFontDescriptorCreateMatchingFontDescriptors has been observed to return nullptr, so we need to handle that explicitly. Fixes: QTBUG-113698 Pick-to: 6.5 6.6 6.2 Change-Id: Ic9fa574c14068fcae98fe8e6ceddd8a4f7008210 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
604b2feca7
commit
9526a76936
|
|
@ -905,7 +905,7 @@ void QCoreTextFontDatabase::populateThemeFonts()
|
|||
|
||||
auto addFontVariants = [&](CTFontDescriptorRef descriptor) {
|
||||
QCFType<CFArrayRef> matchingDescriptors = CTFontDescriptorCreateMatchingFontDescriptors(descriptor, nullptr);
|
||||
const int matchingDescriptorsCount = CFArrayGetCount(matchingDescriptors);
|
||||
const int matchingDescriptorsCount = matchingDescriptors ? CFArrayGetCount(matchingDescriptors) : 0;
|
||||
qCDebug(lcQpaFonts) << "Enumerating font variants based on" << id(descriptor)
|
||||
<< "resulted in" << matchingDescriptorsCount << "matching descriptors"
|
||||
<< matchingDescriptors.as<NSArray*>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue