From 3da75b05841e503c146a326c15b9065eebfe35b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 8 Aug 2014 16:14:56 +0200 Subject: QCoreTextFontDatabase: Remove number type asserts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On iOS 8, the value 0 is returned as a kCFNumberIntType. The code still works - CFNumberGetValue converts it to a 0.0 double. Change-Id: Ic50900b22e4fa19ad1481e8e0e293559bbfd8cd2 Reviewed-by: Tor Arne Vestbø --- src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/platformsupport/fontdatabases') diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index cff90f420b..ca7afb7d1b 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -264,7 +264,6 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd) if (styles) { if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) { - Q_ASSERT(CFNumberIsFloatType(weightValue)); double normalizedWeight; if (CFNumberGetValue(weightValue, kCFNumberDoubleType, &normalizedWeight)) { if (normalizedWeight >= 0.62) @@ -280,7 +279,6 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd) } } if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) { - Q_ASSERT(CFNumberIsFloatType(italic)); double d; if (CFNumberGetValue(italic, kCFNumberDoubleType, &d)) { if (d > 0.0) -- cgit v1.2.3 From a544ef59060a6c430cbb92fceb0d1b0e22492f3f Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 4 Sep 2014 13:29:15 +0200 Subject: QCoreTextFontDatabase: reduce memory consumption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ATSFontNotify() allocates over 30MB for no apparent reason for applications that don't register fonts. Change-Id: I7bbc97f53b76be1e638de8ca0d1be3a08586cf00 Reviewed-by: Tor Arne Vestbø Reviewed-by: Gabriel de Dietrich --- src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/platformsupport/fontdatabases') diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index ca7afb7d1b..063d20dbd4 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -768,6 +768,9 @@ QList QCoreTextFontDatabase::standardSizes() const void QCoreTextFontDatabase::removeApplicationFonts() { + if (m_applicationFonts.isEmpty()) + return; + foreach (const QVariant &font, m_applicationFonts) { #if HAVE_CORETEXT if (&CTFontManagerUnregisterGraphicsFont && &CTFontManagerUnregisterFontsForURL) { -- cgit v1.2.3 From 8206a263ab9bca7fef191d299c05294a00ec1c8f Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sat, 30 Aug 2014 00:40:33 +0200 Subject: Add missing private headers warning Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0 Reviewed-by: Thiago Macieira --- .../fontdatabases/basic/qbasicfontdatabase_p.h | 11 +++++++++++ .../fontdatabases/fontconfig/qfontconfigdatabase_p.h | 11 +++++++++++ .../fontdatabases/fontconfig/qfontenginemultifontconfig_p.h | 11 +++++++++++ .../fontdatabases/genericunix/qgenericunixfontdatabase_p.h | 11 +++++++++++ .../fontdatabases/mac/qcoretextfontdatabase_p.h | 11 +++++++++++ .../fontdatabases/mac/qfontengine_coretext_p.h | 11 +++++++++++ 6 files changed, 66 insertions(+) (limited to 'src/platformsupport/fontdatabases') diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h index 247a2855e2..a512644966 100644 --- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h @@ -42,6 +42,17 @@ #ifndef QBASICFONTDATABASE_H #define QBASICFONTDATABASE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include #include diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h index ba706dc59e..fc929e464d 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h @@ -42,6 +42,17 @@ #ifndef QFONTCONFIGDATABASE_H #define QFONTCONFIGDATABASE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h index 2d93d236e5..3c2be10be6 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h +++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h @@ -42,6 +42,17 @@ #ifndef QFONTENGINEMULTIFONTCONFIG_H #define QFONTENGINEMULTIFONTCONFIG_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include diff --git a/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h b/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h index a8a0b8fe9c..42fd677cf7 100644 --- a/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h @@ -42,6 +42,17 @@ #ifndef QGENERICUNIXFONTDATABASE_H #define QGENERICUNIXFONTDATABASE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #ifdef Q_FONTCONFIGDATABASE diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h index a3da27b28d..10f54310a8 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h @@ -42,6 +42,17 @@ #ifndef QCORETEXTFONTDATABASE_H #define QCORETEXTFONTDATABASE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #define HAVE_CORETEXT QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_4_1) #define HAVE_ATS QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_5, __IPHONE_NA) diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h index b9593b983e..8157742219 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h @@ -42,6 +42,17 @@ #ifndef QFONTENGINE_CORETEXT_P_H #define QFONTENGINE_CORETEXT_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include -- cgit v1.2.3