summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-10-26 14:00:43 +0200
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-10-26 14:00:43 +0200
commit85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34 (patch)
tree191b227596f18333f1609ff824d2746dd7f1090f /src/gui/text
parent26139fcacc05b4a74fce1ef4e0db819118765310 (diff)
parent2d071521228a6bc9ef423cbdbbd8560d28208790 (diff)
Merge remote branch 'qt/master' into lighthouse-master
Conflicts: src/opengl/qwindowsurface_gl.cpp
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp23
-rw-r--r--src/gui/text/qfontengine_p.h2
-rw-r--r--src/gui/text/qfontengine_win.cpp2
-rw-r--r--src/gui/text/qfontsubset.cpp4
-rw-r--r--src/gui/text/qtextdocument_p.cpp4
-rw-r--r--src/gui/text/qtextlayout.cpp2
6 files changed, 27 insertions, 10 deletions
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index a7aa2ce282..ecc4690e67 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;
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index e919d12d8a..6d6daaabdd 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -167,7 +167,7 @@ public:
virtual QFixed emSquareSize() const { return ascent(); }
- /* returns 0 as glyph index for non existant glyphs */
+ /* returns 0 as glyph index for non existent glyphs */
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const = 0;
/**
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index a941dabb2a..cf4fbdad43 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -1209,7 +1209,7 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform)
QImage indexed(mask->width(), mask->height(), QImage::Format_Indexed8);
- // ### This part is kinda pointless, but we'll crash later if we dont because some
+ // ### This part is kinda pointless, but we'll crash later if we don't because some
// code paths expects there to be colortables for index8-bit...
QVector<QRgb> colors(256);
for (int i=0; i<256; ++i)
diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp
index e49f5b4554..22833584b9 100644
--- a/src/gui/text/qfontsubset.cpp
+++ b/src/gui/text/qfontsubset.cpp
@@ -697,7 +697,7 @@ static QTtfTable generateHead(const qttf_head_table &head)
// Bits 5-10: These should be set according to Apple's specification . However, they are not implemented in OpenType.
// Bit 11: Font data is 'lossless,' as a result of having been compressed and decompressed with the Agfa MicroType Express engine.
// Bit 12: Font converted (produce compatible metrics)
-// Bit 13: Font optimised for ClearType
+// Bit 13: Font optimized for ClearType
// Bit 14: Reserved, set to 0
// Bit 15: Reserved, set to 0
<< quint16(0)
@@ -1008,7 +1008,7 @@ static void convertPath(const QPainterPath &path, QList<TTF_POINT> *points, QLis
np.x = (i1_x + i2_x) >> 1;
np.y = (i1_y + i2_y) >> 1;
if (try_reduce) {
- // see if we can optimise out the last onCurve point
+ // see if we can optimize out the last onCurve point
int mx = (points->at(points->size() - 2).x + base[2].x) >> 1;
int my = (points->at(points->size() - 2).y + base[2].y) >> 1;
if (qAbs(mx - base[3].x) <= split_limit && qAbs(my = base[3].y) <= split_limit)
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index 213db7ed9f..0bdd20d347 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -320,7 +320,7 @@ void QTextDocumentPrivate::setLayout(QAbstractTextDocumentLayout *layout)
void QTextDocumentPrivate::insert_string(int pos, uint strPos, uint length, int format, QTextUndoCommand::Operation op)
{
- // ##### optimise when only appending to the fragment!
+ // ##### optimize when only appending to the fragment!
Q_ASSERT(noBlockInString(text.mid(strPos, length)));
split(pos);
@@ -1446,7 +1446,7 @@ void QTextDocumentPrivate::clearFrame(QTextFrame *f)
void QTextDocumentPrivate::scan_frames(int pos, int charsRemoved, int charsAdded)
{
- // ###### optimise
+ // ###### optimize
Q_UNUSED(pos);
Q_UNUSED(charsRemoved);
Q_UNUSED(charsAdded);
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index fad6c3b2fe..dad53711ad 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1687,7 +1687,7 @@ void QTextLine::setLineWidth(qreal width)
if (line.length
&& line.textWidth <= line.width
&& line.from + line.length == eng->layoutData->string.length())
- // no need to do anything if the line is already layouted and the last one. This optimisation helps
+ // no need to do anything if the line is already layouted and the last one. This optimization helps
// when using things in a single line layout.
return;
line.length = 0;