diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 7e3736d6d..44c5f77f4 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1096,7 +1096,6 @@ void QPainterPath::addText(const QPointF &point, const QFont &f, const QString & static const bool scriptdetection = true; if (scriptdetection) { qreal xoffset = 0.0; - qreal yoffset = 0.0; QUnicodeTables::Script inheritedscript = QUnicodeTables::Common; for (int i = 0; i < text.size(); i++) { int nglyphs = 1; @@ -1138,13 +1137,11 @@ void QPainterPath::addText(const QPointF &point, const QFont &f, const QString & QGlyphLayoutArray<2> glyphs; engine->stringToCMap(textchars, nglyphs, &glyphs, &nglyphs, shaperflags); - engine->addOutlineToPath(point.x() + xoffset, point.y() + yoffset, glyphs, this); + engine->addOutlineToPath(point.x() + xoffset, point.y(), glyphs, this); xoffset += glyphs.advances_x[0].toReal(); - yoffset += glyphs.advances_y[0].toReal(); if (nglyphs == 2) { xoffset += glyphs.advances_x[1].toReal(); - yoffset += glyphs.advances_y[1].toReal(); } Q_ASSERT(nglyphs < 3); } diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index d8d0a0619..3cc09a680 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -114,7 +114,6 @@ void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform positions[current].y = ypos + glyphs.offsets[i].y; glyphs_out[current] = glyphs.glyphs[i]; xpos += glyphs.advances_x[i] + QFixed::fromFixed(glyphs.justifications[i].space_18d6); - ypos += glyphs.advances_y[i]; ++current; } ++i; @@ -130,7 +129,6 @@ void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform positions[current].y = QFixed::fromReal(gpos.y()); glyphs_out[current] = glyphs.glyphs[i]; xpos += glyphs.advances_x[i] + QFixed::fromFixed(glyphs.justifications[i].space_18d6); - ypos += glyphs.advances_y[i]; ++current; } ++i; @@ -351,7 +349,6 @@ bool QFontEngineBox::stringToCMap(const QChar *, int len, QGlyphLayout *glyphs, for (int i = 0; i < len; i++) { glyphs->glyphs[i] = 0; glyphs->advances_x[i] = _size; - glyphs->advances_y[i] = 0; } *nglyphs = len; @@ -363,7 +360,6 @@ void QFontEngineBox::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFla { for (int i = 0; i < glyphs->numGlyphs; i++) { glyphs->advances_x[i] = _size; - glyphs->advances_y[i] = 0; } } @@ -433,10 +429,8 @@ void QFontEngineBox::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, in g.glyphs[i] = glyphs[i]; if (i < nGlyphs - 1) { g.advances_x[i] = positions[i+1].x - positions[i].x; - g.advances_y[i] = positions[i+1].y - positions[i].y; } else { g.advances_x[i] = QFixed::fromReal(maxCharWidth()); - g.advances_y[i] = 0; } } @@ -446,7 +440,6 @@ void QFontEngineBox::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, in glyph_metrics_t metrics = boundingBox(g.glyphs[i]); if (metrics.width.value() == 0 || metrics.height.value() == 0) { advanceX += g.advances_x[i]; - advanceY += g.advances_y[i]; continue; } @@ -459,7 +452,6 @@ void QFontEngineBox::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, in path->closeSubpath(); advanceX += g.advances_x[i]; - advanceY += g.advances_y[i]; } } diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index ffbe0332e..9b7e206c3 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -634,7 +634,6 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag : QFixed::fromFixed(metric->horiadvance); if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) glyphs->advances_x[i] = glyphs->advances_x[i].round(); - glyphs->advances_y[i] = 0; } } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 218c4ef07..a4a762246 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -773,7 +773,6 @@ void QGlyphLayout::grow(char *address, int totalGlyphs) // move the existing data memmove(newLayout.attributes, oldLayout.attributes, numGlyphs * sizeof(HB_GlyphAttributes)); memmove(newLayout.justifications, oldLayout.justifications, numGlyphs * sizeof(QGlyphJustification)); - memmove(newLayout.advances_y, oldLayout.advances_y, numGlyphs * sizeof(QFixed)); memmove(newLayout.advances_x, oldLayout.advances_x, numGlyphs * sizeof(QFixed)); memmove(newLayout.glyphs, oldLayout.glyphs, numGlyphs * sizeof(HB_Glyph)); } diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index bb5eb090c..6fde7a72f 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -115,7 +115,6 @@ struct QGlyphLayout QFixedPoint *offsets; // 8 bytes per element HB_Glyph *glyphs; // 4 bytes per element QFixed *advances_x; // 4 bytes per element - QFixed *advances_y; // 4 bytes per element QGlyphJustification *justifications; // 4 bytes per element HB_GlyphAttributes *attributes; // 2 bytes per element @@ -131,8 +130,6 @@ struct QGlyphLayout offset += totalGlyphs * sizeof(HB_Glyph); advances_x = reinterpret_cast(address + offset); offset += totalGlyphs * sizeof(QFixed); - advances_y = reinterpret_cast(address + offset); - offset += totalGlyphs * sizeof(QFixed); justifications = reinterpret_cast(address + offset); offset += totalGlyphs * sizeof(QGlyphJustification); attributes = reinterpret_cast(address + offset); @@ -143,7 +140,6 @@ struct QGlyphLayout QGlyphLayout copy = *this; copy.glyphs += position; copy.advances_x += position; - copy.advances_y += position; copy.offsets += position; copy.justifications += position; copy.attributes += position; @@ -156,7 +152,7 @@ struct QGlyphLayout static inline int spaceNeededForGlyphLayout(int totalGlyphs) { return totalGlyphs * (sizeof(HB_Glyph) + sizeof(HB_GlyphAttributes) - + sizeof(QFixed) + sizeof(QFixed) + sizeof(QFixedPoint) + + sizeof(QFixed) + sizeof(QFixedPoint) + sizeof(QGlyphJustification)); } @@ -174,7 +170,6 @@ struct QGlyphLayout memset(offsets + first, 0, num * sizeof(QFixedPoint)); memset(glyphs + first, 0, num * sizeof(HB_Glyph)); memset(advances_x + first, 0, num * sizeof(QFixed)); - memset(advances_y + first, 0, num * sizeof(QFixed)); memset(justifications + first, 0, num * sizeof(QGlyphJustification)); memset(attributes + first, 0, num * sizeof(HB_GlyphAttributes)); } @@ -219,7 +214,7 @@ public: private: void *buffer[(N * (sizeof(HB_Glyph) + sizeof(HB_GlyphAttributes) - + sizeof(QFixed) + sizeof(QFixed) + sizeof(QFixedPoint) + + sizeof(QFixed) + sizeof(QFixedPoint) + sizeof(QGlyphJustification))) / QT_POINTER_SIZE + 1]; };