summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
diff options
context:
space:
mode:
authorBjoern Breitmeyer <bjoern.breitmeyer@kdab.com>2012-05-10 14:43:26 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-10 22:56:25 +0200
commit9b9895de8da08776e586f20807d4698e5d9e5680 (patch)
treec76d3316e75c93a6c993f0fea148f496cd3b291a /src/plugins/platforms/windows/qwindowsfontdatabase.cpp
parent4e8c20e97e17881e2de20640f81c3998f024287d (diff)
Fix for windows platform plugin to work with WINCE.
Made opengl optional. Made Clipboard and Accessability optional. Moved internal mime data into its on source file, was implemented in the clipboard source which is just strange. Change-Id: I6ddf0c656533bd45e22e24492fc2254d15b7822f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsfontdatabase.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index caa1913bb5..7e8c70ee44 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -55,9 +55,13 @@
#include <wchar.h>
+#ifdef Q_OS_WINCE
+# include "qplatformfunctions_wince.h"
+#endif
+
#if !defined(QT_NO_DIRECTWRITE)
-# include <dwrite.h>
-# include <d2d1.h>
+# include <dwrite.h>
+# include <d2d1.h>
#endif
QT_BEGIN_NAMESPACE
@@ -1002,6 +1006,17 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
quint32 codePageRange[2] = {
signature->fsCsb[0], signature->fsCsb[1]
};
+#ifdef Q_OS_WINCE
+ if (signature->fsUsb[0] == 0) {
+ // If the unicode ranges bit mask is zero then
+ // EnumFontFamiliesEx failed to determine it properly.
+ // In this case we just pretend that the font supports all languages.
+ unicodeRange[0] = 0xbfffffff; // second most significant bit must be zero
+ unicodeRange[1] = 0xffffffff;
+ unicodeRange[2] = 0xffffffff;
+ unicodeRange[3] = 0xffffffff;
+ }
+#endif
writingSystemsFromTrueTypeBits(unicodeRange, codePageRange, &writingSystems);
// ### Hack to work around problem with Thai text on Windows 7. Segoe UI contains
// the symbol for Baht, and Windows thus reports that it supports the Thai script.
@@ -1603,6 +1618,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(int script, const QFontDef &requ
const QString fam = request.family.toLower();
if (fam == QStringLiteral("default") || fam == QStringLiteral("system"))
f = SYSTEM_FONT;
+#ifndef Q_OS_WINCE
else if (fam == QStringLiteral("system_fixed"))
f = SYSTEM_FIXED_FONT;
else if (fam == QStringLiteral("ansi_fixed"))
@@ -1613,6 +1629,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(int script, const QFontDef &requ
f = DEVICE_DEFAULT_FONT;
else if (fam == QStringLiteral("oem_fixed"))
f = OEM_FIXED_FONT;
+#endif
else if (fam.at(0) == QLatin1Char('#'))
f = fam.right(fam.length()-1).toInt();
hfont = (HFONT)GetStockObject(f);
@@ -1657,12 +1674,14 @@ QFontEngine *QWindowsFontDatabase::createEngine(int script, const QFontDef &requ
int strat = OUT_DEFAULT_PRECIS;
if (request.styleStrategy & QFont::PreferBitmap) {
strat = OUT_RASTER_PRECIS;
+#ifndef Q_OS_WINCE
} else if (request.styleStrategy & QFont::PreferDevice) {
strat = OUT_DEVICE_PRECIS;
} else if (request.styleStrategy & QFont::PreferOutline) {
strat = OUT_OUTLINE_PRECIS;
} else if (request.styleStrategy & QFont::ForceOutline) {
strat = OUT_TT_ONLY_PRECIS;
+#endif
}
lf.lfOutPrecision = strat;
@@ -1671,8 +1690,10 @@ QFontEngine *QWindowsFontDatabase::createEngine(int script, const QFontDef &requ
if (request.styleStrategy & QFont::PreferMatch)
qual = DRAFT_QUALITY;
+#ifndef Q_OS_WINCE
else if (request.styleStrategy & QFont::PreferQuality)
qual = PROOF_QUALITY;
+#endif
if (request.styleStrategy & QFont::PreferAntialias) {
if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP) {
@@ -1733,10 +1754,17 @@ QFontEngine *QWindowsFontDatabase::createEngine(int script, const QFontDef &requ
qErrnoWarning("%s: CreateFontIndirect with stretch failed", __FUNCTION__);
}
+#ifndef Q_OS_WINCE
if (hfont == 0) {
hfont = (HFONT)GetStockObject(ANSI_VAR_FONT);
stockFont = true;
}
+#else
+ if (hfont == 0) {
+ hfont = (HFONT)GetStockObject(SYSTEM_FONT);
+ stockFont = true;
+ }
+#endif
}
#if !defined(QT_NO_DIRECTWRITE)