diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-09-08 19:03:05 (GMT) |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-09-08 19:58:02 (GMT) |
commit | c207a85d9d8e541a30f7dd7f0721f204757650e1 (patch) | |
tree | 60c2f4d4ac34044cdf1d5c5cdb137d3b916ccbed /src/gui/text | |
parent | 0c49838016ab77d596f53774d8432f9f4d6b1188 (diff) | |
download | Qt-c207a85d9d8e541a30f7dd7f0721f204757650e1.zip Qt-c207a85d9d8e541a30f7dd7f0721f204757650e1.tar.gz Qt-c207a85d9d8e541a30f7dd7f0721f204757650e1.tar.bz2 |
Moved font list getter to qfontdatabase_s60.cpp. Reusable.
Preparations for Application font support on Symbian
Task-Number: QTBUG-6611
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfont_s60.cpp | 13 | ||||
-rw-r--r-- | src/gui/text/qfontdatabase_s60.cpp | 15 |
2 files changed, 19 insertions, 9 deletions
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp index 2d547a9..d39f30a 100644 --- a/src/gui/text/qfont_s60.cpp +++ b/src/gui/text/qfont_s60.cpp @@ -49,16 +49,11 @@ QT_BEGIN_NAMESPACE #ifdef QT_NO_FREETYPE Q_GLOBAL_STATIC(QMutex, lastResortFamilyMutex); +extern QStringList qt_symbian_fontFamiliesOnFontServer(); // qfontdatabase_s60.cpp Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, fontFamiliesOnFontServer, { - QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock); - const int numTypeFaces = S60->screenDevice()->NumTypefaces(); - for (int i = 0; i < numTypeFaces; i++) { - TTypefaceSupport typefaceSupport; - S60->screenDevice()->TypefaceSupport(typefaceSupport, i); - const QString familyName((const QChar *)typefaceSupport.iTypeface.iName.Ptr(), typefaceSupport.iTypeface.iName.Length()); - x->append(familyName); - } - lock.relock(); + // We are only interested in the initial font families. No Application fonts. + // Therefore, we are allowed to cache the list. + x->append(qt_symbian_fontFamiliesOnFontServer()); }); #endif // QT_NO_FREETYPE diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index f9d8d31..b73555f 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -58,6 +58,21 @@ QT_BEGIN_NAMESPACE +QStringList qt_symbian_fontFamiliesOnFontServer() // Also used in qfont_s60.cpp +{ + QStringList result; + QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock); + const int numTypeFaces = S60->screenDevice()->NumTypefaces(); + for (int i = 0; i < numTypeFaces; i++) { + TTypefaceSupport typefaceSupport; + S60->screenDevice()->TypefaceSupport(typefaceSupport, i); + const QString familyName((const QChar *)typefaceSupport.iTypeface.iName.Ptr(), typefaceSupport.iTypeface.iName.Length()); + result.append(familyName); + } + lock.relock(); + return result; +} + QFileInfoList alternativeFilePaths(const QString &path, const QStringList &nameFilters, QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort, bool uniqueFileNames = true) |