Set supporting writingSystem correctly
Change-Id: I963aa7b69a48441619c5885c443ae2620fcc4e57 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
This commit is contained in:
parent
8f2da7cd63
commit
f8725f2c8d
@ -213,11 +213,12 @@ void QCoreTextFontDatabase::populateFontDatabase()
|
||||
|
||||
QSupportedWritingSystems writingSystems;
|
||||
if (QCFType<CFArrayRef> languages = (CFArrayRef) CTFontDescriptorCopyAttribute(font, kCTFontLanguagesAttribute)) {
|
||||
CFIndex length = CFArrayGetCount(languages);
|
||||
for (int i = 1; i < LanguageCount; ++i) {
|
||||
if (!languageForWritingSystem[i])
|
||||
continue;
|
||||
QCFString lang = CFStringCreateWithCString(NULL, languageForWritingSystem[i], kCFStringEncodingASCII);
|
||||
if (CFArrayContainsValue(languages, CFRangeMake(0, 0), lang))
|
||||
if (CFArrayContainsValue(languages, CFRangeMake(0, length), lang))
|
||||
writingSystems.setSupported(QFontDatabase::WritingSystem(i));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user