summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@nokia.com>2011-02-02 15:57:39 (GMT)
committerYoann Lopes <yoann.lopes@nokia.com>2011-02-02 15:57:39 (GMT)
commit2fc0d4ca43afb4072e92fd15648285c2c26d9da1 (patch)
tree097d06bc9ac5512dd9431ad2be1b4eee0c47048d /src/gui/text
parente0a4c25a2276b998bc1514073bbe68d1eefb4345 (diff)
parentcf3420c698a0713bf32a4c18ccd7c145cbf581f3 (diff)
downloadQt-2fc0d4ca43afb4072e92fd15648285c2c26d9da1.zip
Qt-2fc0d4ca43afb4072e92fd15648285c2c26d9da1.tar.gz
Qt-2fc0d4ca43afb4072e92fd15648285c2c26d9da1.tar.bz2
Merge branch 'integration'
Conflicts: src/gui/kernel/qapplication_s60.cpp src/gui/text/qfontdatabase_s60.cpp
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfont_s60.cpp18
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp2
-rw-r--r--src/gui/text/text.pri2
3 files changed, 19 insertions, 3 deletions
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp
index c7d36ef..114191d 100644
--- a/src/gui/text/qfont_s60.cpp
+++ b/src/gui/text/qfont_s60.cpp
@@ -49,13 +49,14 @@ QT_BEGIN_NAMESPACE
#ifdef QT_NO_FREETYPE
Q_GLOBAL_STATIC(QMutex, lastResortFamilyMutex);
+#endif // QT_NO_FREETYPE
+
extern QStringList qt_symbian_fontFamiliesOnFontServer(); // qfontdatabase_s60.cpp
Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, fontFamiliesOnFontServer, {
// 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
QString QFont::lastResortFont() const
{
@@ -95,7 +96,20 @@ QString QFont::lastResortFamily() const
const bool isJapaneseOrChineseSystem =
User::Language() == ELangJapanese || User::Language() == ELangPrcChinese;
- return QLatin1String(isJapaneseOrChineseSystem?"Heisei Kaku Gothic S60":"Series 60 Sans");
+ static QString family;
+ if (family.isEmpty()) {
+ QStringList families = qt_symbian_fontFamiliesOnFontServer();
+ const char* const preferredFamilies[] = {"Nokia Sans S60", "Series 60 Sans"};
+ for (int i = 0; i < sizeof preferredFamilies / sizeof preferredFamilies[0]; ++i) {
+ const QString preferredFamily = QLatin1String(preferredFamilies[i]);
+ if (families.contains(preferredFamily)) {
+ family = preferredFamily;
+ break;
+ }
+ }
+ }
+
+ return QLatin1String(isJapaneseOrChineseSystem?"Heisei Kaku Gothic S60":family.toLatin1());
#endif // QT_NO_FREETYPE
}
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 97426a8..6d3970e 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -464,6 +464,7 @@ void QFontEngineMultiS60::loadEngine(int at)
Q_ASSERT(engines[at]);
}
+#ifdef QT_NO_FREETYPE
static bool registerScreenDeviceFont(int screenDeviceFontIndex,
const QSymbianFontDatabaseExtrasImplementation *dbExtras)
{
@@ -525,6 +526,7 @@ static bool registerScreenDeviceFont(int screenDeviceFontIndex,
family->writingSystems[system] = QtFontFamily::Supported;
return true;
}
+#endif
static void initializeDb()
{
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index daafdd9..d3e8f2d 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -147,8 +147,8 @@ symbian {
text/qfontengine_s60.cpp
HEADERS += \
text/qfontengine_s60_p.h
- LIBS += -lfntstr -lecom
}
+ LIBS += -lfntstr -lecom
}
!qpa {