From 6cc32482afd610e2808bde42b6a01dd78b79d809 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 2 Aug 2011 13:38:04 +0200 Subject: Detect linked fonts by name (insead of via CLinkedTypeface* Api) The detection of Linked Fonts via CLinkedTypeface* Api does not work in all cases. It works in QML apps, but not in QWidgets based apps. The reason is still unclear. This commit replaces the CLinkedTypeface* Api based code of commit fa344b355d311fce7954e2fd1a22a87a88194783 whith a simple type face anme analysis. Assumption is that the names of Linked Fonts always end with "LF" and are all upper case. This patch has been tested by more people than just me, but it is too dirty to mention the others as reviewer. I take the shame and blame. Task-Number: QTBUG-20007 --- src/gui/text/qfontdatabase_s60.cpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index ffecca7..f29c880 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -62,33 +62,14 @@ #define SYMBIAN_LINKEDFONTS_SUPPORTED #endif // !SYMBIAN_VERSION_9_4 -#ifdef SYMBIAN_LINKEDFONTS_SUPPORTED -#include -#endif // SYMBIAN_LINKEDFONTS_SUPPORTED - QT_BEGIN_NAMESPACE -#ifdef SYMBIAN_LINKEDFONTS_SUPPORTED -static bool isLinkedFontL(const TDesC &aTypefaceName) -{ - CLinkedTypefaceSpecification *linkedspec = CLinkedTypefaceSpecification::NewLC(aTypefaceName); - CFbsTypefaceStore *tfs = CFbsTypefaceStore::NewL(NULL); - CleanupStack::PushL(tfs); - linkedspec->FetchLinkedTypefaceSpecificationL(*tfs); - CleanupStack::PopAndDestroy(tfs); - CleanupStack::PopAndDestroy(linkedspec); - return true; -} -#endif // SYMBIAN_LINKEDFONTS_SUPPORTED - bool qt_symbian_isLinkedFont(const TDesC &typefaceName) // Also used in qfont_s60.cpp { bool isLinkedFont = false; #ifdef SYMBIAN_LINKEDFONTS_SUPPORTED - if (RFbsSession::Connect() == KErrNone) { - TRAP_IGNORE(isLinkedFont = isLinkedFontL(typefaceName)); - RFbsSession::Disconnect(); - } + const QString name((const QChar*)typefaceName.Ptr(), typefaceName.Length()); + isLinkedFont = name.endsWith(QLatin1String("LF")) && name == name.toUpper(); #endif // SYMBIAN_LINKEDFONTS_SUPPORTED return isLinkedFont; } -- cgit v0.12