From 586d9e6013de94e5affd0ea6b079799cce069f2d Mon Sep 17 00:00:00 2001 From: Fan RuiJie Date: Mon, 30 Aug 2021 10:26:59 +0800 Subject: [PATCH] Fix text ellipsis not implemented in Tibetan The original code checks the existence of an ellipsis character first.If this does not exist (glyph == 0,which is an invalid glyph index), then it falls back to looking up '.'. But in the Tibetan environment,the glyphIndex('.') also returns 0, so that it simply doesn't add any form of "...", and cuts the text instead. If both the attempts at getting something from the main font fails, we can do a third pass on the "multi" font engine. Fixes: QTBUG-95942 Pick-to: 6.1 6.2 Done-with: Eskil Abrahamsen Blomfeldt Change-Id: I251de3fe92e19be0462c58c2059ecf7d354bfbb0 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextengine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 464de23dd4d..b8ffaf31514 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -3095,6 +3095,11 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int ellipsisWidth *= 3; ellipsisText = QStringLiteral("..."); + } else { + engine = fnt.d->engineForScript(QChar::Script_Common); + glyph = engine->glyphIndex(ellipsisChar.unicode()); + engine->recalcAdvances(&glyphs, { }); + ellipsisText = ellipsisChar; } } }