diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2011-08-02 11:38:04 (GMT) |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2011-08-02 11:52:42 (GMT) |
commit | 6cc32482afd610e2808bde42b6a01dd78b79d809 (patch) | |
tree | ccaaab265487f83fd191e8d1b32d2fc2651aca2e /src/gui/text | |
parent | 7c499bcfbf7f9c52b3d6523fea8396bd4ab7252e (diff) | |
download | Qt-6cc32482afd610e2808bde42b6a01dd78b79d809.zip Qt-6cc32482afd610e2808bde42b6a01dd78b79d809.tar.gz Qt-6cc32482afd610e2808bde42b6a01dd78b79d809.tar.bz2 |
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
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontdatabase_s60.cpp | 23 |
1 files 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 <linkedfonts.h> -#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; } |