summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontdatabase_x11.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-10-26 12:00:43 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-10-26 12:00:43 (GMT)
commit85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34 (patch)
tree191b227596f18333f1609ff824d2746dd7f1090f /src/gui/text/qfontdatabase_x11.cpp
parent26139fcacc05b4a74fce1ef4e0db819118765310 (diff)
parent2d071521228a6bc9ef423cbdbbd8560d28208790 (diff)
downloadQt-85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34.zip
Qt-85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34.tar.gz
Qt-85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34.tar.bz2
Merge remote branch 'qt/master' into lighthouse-master
Conflicts: src/opengl/qwindowsurface_gl.cpp
Diffstat (limited to 'src/gui/text/qfontdatabase_x11.cpp')
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index a7aa2ce..ecc4690 100644
--- a/src/gui/text/qfontdatabase_x11.cpp
+++ b/src/gui/text/qfontdatabase_x11.cpp
@@ -1891,6 +1891,18 @@ QFontEngine *QFontDatabase::loadXlfd(int screen, int script, const QFontDef &req
return fe;
}
+#if (defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6)) && defined(Q_CC_GNU) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
+#define NEEDS_GCC_BUG_WORKAROUND
+#endif
+
+#ifdef NEEDS_GCC_BUG_WORKAROUND
+static inline void gccBugWorkaround(const QFontDef &req)
+{
+ char buffer[8];
+ snprintf(buffer, 8, "%f", req.pixelSize);
+}
+#endif
+
/*! \internal
Loads a QFontEngine for the specified \a script that matches the
QFontDef \e request member variable.
@@ -1902,9 +1914,15 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
// normalize the request to get better caching
QFontDef req = d->request;
if (req.pixelSize <= 0)
- req.pixelSize = floor(qt_pixelSize(req.pointSize, d->dpi) * 100 + 0.5) / 100;
+ req.pixelSize = qFloor(qt_pixelSize(req.pointSize, d->dpi) * 100.0 + 0.5) * 0.01;
if (req.pixelSize < 1)
req.pixelSize = 1;
+
+#ifdef NEEDS_GCC_BUG_WORKAROUND
+ // req.pixelSize ends up with a bogus value unless this workaround is called
+ gccBugWorkaround(req);
+#endif
+
if (req.weight == 0)
req.weight = QFont::Normal;
if (req.stretch == 0)
@@ -1940,7 +1958,6 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
#ifndef QT_NO_FONTCONFIG
} else if (X11->has_fontconfig) {
fe = loadFc(d, script, req);
-
if (fe != 0 && fe->fontDef.pixelSize != req.pixelSize && mainThread && qt_is_gui_used) {
QFontEngine *xlfdFontEngine = loadXlfd(d->screen, script, req);
if (xlfdFontEngine->fontDef.family == fe->fontDef.family) {
@@ -1989,7 +2006,7 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
FcFontSet *set = FcConfigGetFonts(config, FcSetApplication);
if (!set) {
- FcConfigAppFontAddFile(config, (const FcChar8 *)":/non-existant");
+ FcConfigAppFontAddFile(config, (const FcChar8 *)":/non-existent");
set = FcConfigGetFonts(config, FcSetApplication); // try again
if (!set)
return;