summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFan RuiJie <fanruijie@uniontech.com>2021-08-30 10:26:59 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-18 18:03:33 +0000
commit6616eadcb23859ce0748dc6f974f2d91972f01a3 (patch)
treea36588098ee20558a7dff5b078bac2dd5f4a7a26 /src/gui
parent900bbf3b242a78a078bafe56f0cbe4ce70181abf (diff)
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 Done-with: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Change-Id: I251de3fe92e19be0462c58c2059ecf7d354bfbb0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 586d9e6013de94e5affd0ea6b079799cce069f2d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextengine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 74967aeac9..c031f4ce96 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;
}
}
}