From fa7661d8b25fa338649a301010e1b5a2b63da731 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 11 Jul 2012 14:39:54 +0200 Subject: Fix styleName support in QPA font database Font styleName support was disconnected since Qt switched to QPA fontdatabase. Now add the code from Qt 4.8 back to enable this in QPA. Change-Id: Iab2cbfd5468f87542183348c2123ca4b2c270692 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm') diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 99a316bef3..4ea38cb74e 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -227,6 +227,7 @@ void QCoreTextFontDatabase::populateFontDatabase() for (int i = 0; i < numFonts; ++i) { CTFontDescriptorRef font = (CTFontDescriptorRef) CFArrayGetValueAtIndex(fonts, i); QCFString familyName = (CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontFamilyNameAttribute, NULL); + QCFString styleName = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute(font, kCTFontStyleNameAttribute, NULL); QCFType styles = (CFDictionaryRef) CTFontDescriptorCopyAttribute(font, kCTFontTraitsAttribute); QFont::Weight weight = QFont::Normal; QFont::Style style = QFont::StyleNormal; @@ -285,7 +286,7 @@ void QCoreTextFontDatabase::populateFontDatabase() } CFRetain(font); - QPlatformFontDatabase::registerFont(familyName, foundryName, weight, style, stretch, + QPlatformFontDatabase::registerFont(familyName, styleName, foundryName, weight, style, stretch, true /* antialiased */, true /* scalable */, pixelSize, fixedPitch, writingSystems, (void *) font); CFStringRef psName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontNameAttribute); -- cgit v1.2.3