diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-01-03 14:20:01 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-01-04 11:12:05 +0100 |
commit | ca2f44680cb97e7a7c46ee0ab26654822fe65e2d (patch) | |
tree | b9d85ad8ec1b18a6aa56b7657812cf3791bdf72e /src/platformsupport/fontdatabases | |
parent | 28a21d98ef8d880a6dd86ee19dd803424bb5eae1 (diff) | |
parent | 83188c6499ccdc87c0a2c468bb497e287f5db369 (diff) |
Merge branch 'stable' into dev
Conflicts:
examples/widgets/painting/shared/shared.pri
src/corelib/tools/qharfbuzz_p.h
src/corelib/tools/qunicodetools.cpp
src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
src/plugins/platforms/windows/qwindowsfontdatabase.cpp
Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
Diffstat (limited to 'src/platformsupport/fontdatabases')
4 files changed, 12 insertions, 8 deletions
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp index d0755711de..d50d23e2a9 100644 --- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp @@ -452,7 +452,7 @@ QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByt QFont::Stretch stretch = QFont::Unstretched; - registerFont(family,QString(),weight,style,stretch,true,true,0,fixedPitch,writingSystems,fontFile); + registerFont(family,QString::fromLatin1(face->style_name),QString(),weight,style,stretch,true,true,0,fixedPitch,writingSystems,fontFile); families.append(family); diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 128ef396db..2e458d9153 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -362,6 +362,7 @@ void QFontconfigDatabase::populateFontDatabase() FcChar8 *file_value; int indexValue; FcChar8 *foundry_value; + FcChar8 *style_value; FcBool scalable; FcBool antialias; @@ -369,7 +370,7 @@ void QFontconfigDatabase::populateFontDatabase() FcObjectSet *os = FcObjectSetCreate(); FcPattern *pattern = FcPatternCreate(); const char *properties [] = { - FC_FAMILY, FC_WEIGHT, FC_SLANT, + FC_FAMILY, FC_STYLE, FC_WEIGHT, FC_SLANT, FC_SPACING, FC_FILE, FC_INDEX, FC_LANG, FC_CHARSET, FC_FOUNDRY, FC_SCALABLE, FC_PIXEL_SIZE, FC_WEIGHT, FC_WIDTH, @@ -415,6 +416,8 @@ void QFontconfigDatabase::populateFontDatabase() scalable = FcTrue; if (FcPatternGetString(fonts->fonts[i], FC_FOUNDRY, 0, &foundry_value) != FcResultMatch) foundry_value = 0; + if (FcPatternGetString(fonts->fonts[i], FC_STYLE, 0, &style_value) != FcResultMatch) + style_value = 0; if(FcPatternGetBool(fonts->fonts[i],FC_ANTIALIAS,0,&antialias) != FcResultMatch) antialias = true; @@ -482,7 +485,8 @@ void QFontconfigDatabase::populateFontDatabase() bool fixedPitch = spacing_value >= FC_MONO; QFont::Stretch stretch = QFont::Unstretched; - QPlatformFontDatabase::registerFont(familyName,QLatin1String((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,writingSystems,fontFile); + QString styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString(); + QPlatformFontDatabase::registerFont(familyName,styleName,QLatin1String((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,writingSystems,fontFile); // qDebug() << familyName << (const char *)foundry_value << weight << style << &writingSystems << scalable << true << pixel_size; } @@ -506,9 +510,9 @@ void QFontconfigDatabase::populateFontDatabase() while (f->qtname) { QString familyQtName = QString::fromLatin1(f->qtname); - registerFont(familyQtName,QString(),QFont::Normal,QFont::StyleNormal,QFont::Unstretched,true,true,0,f->fixed,ws,0); - registerFont(familyQtName,QString(),QFont::Normal,QFont::StyleItalic,QFont::Unstretched,true,true,0,f->fixed,ws,0); - registerFont(familyQtName,QString(),QFont::Normal,QFont::StyleOblique,QFont::Unstretched,true,true,0,f->fixed,ws,0); + registerFont(familyQtName,QString(),QString(),QFont::Normal,QFont::StyleNormal,QFont::Unstretched,true,true,0,f->fixed,ws,0); + registerFont(familyQtName,QString(),QString(),QFont::Normal,QFont::StyleItalic,QFont::Unstretched,true,true,0,f->fixed,ws,0); + registerFont(familyQtName,QString(),QString(),QFont::Normal,QFont::StyleOblique,QFont::Unstretched,true,true,0,f->fixed,ws,0); ++f; } diff --git a/src/platformsupport/fontdatabases/fontdatabases.pri b/src/platformsupport/fontdatabases/fontdatabases.pri index 0fc4e71a3f..003017473b 100644 --- a/src/platformsupport/fontdatabases/fontdatabases.pri +++ b/src/platformsupport/fontdatabases/fontdatabases.pri @@ -1,5 +1,4 @@ DEFINES += QT_COMPILES_IN_HARFBUZZ -INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src !win32|contains(QT_CONFIG, freetype):!mac { include($$PWD/basic/basic.pri) diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index ef0c1b5103..edb0e90163 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<CFDictionaryRef> 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); |