summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-07-13 14:47:26 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-07-14 11:39:49 (GMT)
commit81856e8b008099e39465543c3e85049380256cbb (patch)
tree18d36c5561d033b08221adb97b6b225fee3e1ee9 /src/gui/text
parent1348b33591182e16264ff15854efe849638ca04c (diff)
downloadQt-81856e8b008099e39465543c3e85049380256cbb.zip
Qt-81856e8b008099e39465543c3e85049380256cbb.tar.gz
Qt-81856e8b008099e39465543c3e85049380256cbb.tar.bz2
Support RTL text in QGlyphs
RTL text would be positioned wrong with QGlyphs, as we would not correctly detect the direction of the text and pass it into getGlyphPositions(). The bidi analysis is the same as in the QTextLine::draw() method. Reviewed-by: Kim
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextlayout.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 4dda114..43900c0 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2228,6 +2228,8 @@ QList<QGlyphs> QTextLine::glyphs() const
flags |= QTextItem::Underline;
if (font.strikeOut())
flags |= QTextItem::StrikeOut;
+ if (si.analysis.bidiLevel % 2)
+ flags |= QTextItem::RightToLeft;
QGlyphLayout glyphLayout = eng->shapedGlyphs(&si).mid(iterator.glyphsStart,
iterator.glyphsEnd - iterator.glyphsStart);
@@ -2285,7 +2287,8 @@ QList<QGlyphs> QTextLine::glyphs() const
QVarLengthArray<glyph_t> glyphsArray;
QVarLengthArray<QFixedPoint> positionsArray;
- fontEngine->getGlyphPositions(glyphLayout, QTransform(), 0, glyphsArray, positionsArray);
+ fontEngine->getGlyphPositions(glyphLayout, QTransform(), flags, glyphsArray,
+ positionsArray);
Q_ASSERT(glyphsArray.size() == positionsArray.size());
QVector<quint32> glyphs;