Fix QPainterPath with QFont::SmallCaps

Previous code was getting the QFontEngine from the font+script instead of from
the QTextEngine.

The font+script is not enough information to know if a given character is
smallcaps or not, while the QTextEngine actually has access to the information
needed and returns a properly a scaled fontengine if character is small caps

Pick-to: 6.2
Fixes: QTBUG-13965
Change-Id: I9f95bd2f3c3bdff76c3acb94fa2edc99cdeb0a13
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Albert Astals Cid 2021-09-28 17:34:41 +02:00
parent 6cd1d6e927
commit c89c145616

View File

@ -1222,7 +1222,7 @@ void QPainterPath::addText(const QPointF &point, const QFont &f, const QString &
if (si.analysis.flags < QScriptAnalysis::TabOrObject) {
QGlyphLayout glyphs = eng->shapedGlyphs(&si);
QFontEngine *fe = f.d->engineForScript(si.analysis.script);
QFontEngine *fe = eng->fontEngine(si);
Q_ASSERT(fe);
fe->addOutlineToPath(x, y, glyphs, this,
si.analysis.bidiLevel % 2