summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-06-17 13:37:51 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-21 05:35:11 +0000
commitc7115a50a75155f60ccf595ee10c76fc814e9051 (patch)
tree8f2d9daa25415019a9ae6ffdc29b119c5dc8af62 /src
parent380294a5971da85010a708dc23b0edec192cbf27 (diff)
Fix right-to-left text with DirectWrite engine + QPainterPath
When QPainterPath was used for RTL text, either directly or because the target text size exceeds 64 pixels, we would pass true for "isRightToLeft" to DirectWrite, causing it to do adaptation internally for this. But the RTL layout had already been handled by Qt, so we would essentially reverse the layout twice and also move the text to negative X coordinates. Passing false instead fixes this, as it will then just use the positions we pass in blindly. Fixes: QTBUG-94175 Change-Id: Ie9a47e56e97fc867ede10ab21ac5e3f003ddcacb Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 30399fb95cf8b528ac4b45766ac55c6f0a16e2f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/windows/qwindowsfontenginedirectwrite.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/text/windows/qwindowsfontenginedirectwrite.cpp b/src/gui/text/windows/qwindowsfontenginedirectwrite.cpp
index 071273408e..0dac9769ef 100644
--- a/src/gui/text/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/gui/text/windows/qwindowsfontenginedirectwrite.cpp
@@ -517,6 +517,7 @@ void QWindowsFontEngineDirectWrite::recalcAdvances(QGlyphLayout *glyphs, QFontEn
void QWindowsFontEngineDirectWrite::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
QPainterPath *path, QTextItem::RenderFlags flags)
{
+ Q_UNUSED(flags);
QVarLengthArray<UINT16> glyphIndices(nglyphs);
QVarLengthArray<DWRITE_GLYPH_OFFSET> glyphOffsets(nglyphs);
QVarLengthArray<FLOAT> glyphAdvances(nglyphs);
@@ -536,7 +537,7 @@ void QWindowsFontEngineDirectWrite::addGlyphsToPath(glyph_t *glyphs, QFixedPoint
glyphOffsets.data(),
nglyphs,
false,
- flags & QTextItem::RightToLeft,
+ false,
&geometrySink
);