From 9542c54a295d6151c467f106c43c3c15ff4653cd Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 21 Apr 2010 12:27:04 +0200 Subject: Fix mirrored characters for RTL text in Symbian For RTL text rendering (Arabic, Hebrew), we need certain characters to be mirrored, such as brackets. This patch fixes QFontEngineS60::stringToCMap to use QChar::mirroredChar for RTL text. Task-number: QT-3299 Reviewed-by: lars --- src/gui/text/qfontengine_s60.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index c9ff661..1a99c93 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -221,9 +221,11 @@ bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout HB_Glyph *g = glyphs->glyphs; const unsigned char* cmap = m_extensions->cmap(); + const bool isRtl = (flags & QTextEngine::RightToLeft); for (int i = 0; i < len; ++i) { const unsigned int uc = getChar(characters, i, len); - *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, uc); + *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, + isRtl ? QChar::mirroredChar(uc) : uc); } glyphs->numGlyphs = g - glyphs->glyphs; -- cgit v0.12