summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontdatabase_s60.cpp
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@nokia.com>2011-08-02 13:38:04 +0200
committerAlessandro Portale <alessandro.portale@nokia.com>2011-08-02 13:52:42 +0200
commit6cc32482afd610e2808bde42b6a01dd78b79d809 (patch)
treeccaaab265487f83fd191e8d1b32d2fc2651aca2e /src/gui/text/qfontdatabase_s60.cpp
parent7c499bcfbf7f9c52b3d6523fea8396bd4ab7252e (diff)
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/qfontdatabase_s60.cpp')
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index ffecca735f..f29c880cc9 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;
}