Fix font rendering when Qt is configured with -no-harfbuzz
When Qt was configured with -no-harfbuzz, we would get overlapping glyphs, because we skipped the shaping step but did not set up things correctly before that. Instead, we force the PreferNoShaping code path when there is no shaper available. [ChangeLog][Text] Fixed font layouts when Qt was configured without Harfbuzz. Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-100361 Change-Id: I1c54dbc457dbb235548b9d70324d607a0ee6d501 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
8a5fa635ca
commit
81fdfcfc4a
@ -1403,15 +1403,17 @@ void QTextEngine::shapeText(int item) const
|
||||
|
||||
bool kerningEnabled;
|
||||
bool letterSpacingIsAbsolute;
|
||||
bool shapingEnabled;
|
||||
bool shapingEnabled = false;
|
||||
QFixed letterSpacing, wordSpacing;
|
||||
#ifndef QT_NO_RAWFONT
|
||||
if (useRawFont) {
|
||||
QTextCharFormat f = format(&si);
|
||||
QFont font = f.font();
|
||||
kerningEnabled = font.kerning();
|
||||
# if QT_CONFIG(harfbuzz)
|
||||
shapingEnabled = QFontEngine::scriptRequiresOpenType(QChar::Script(si.analysis.script))
|
||||
|| (font.styleStrategy() & QFont::PreferNoShaping) == 0;
|
||||
# endif
|
||||
wordSpacing = QFixed::fromReal(font.wordSpacing());
|
||||
letterSpacing = QFixed::fromReal(font.letterSpacing());
|
||||
letterSpacingIsAbsolute = true;
|
||||
@ -1420,8 +1422,10 @@ void QTextEngine::shapeText(int item) const
|
||||
{
|
||||
QFont font = this->font(si);
|
||||
kerningEnabled = font.d->kerning;
|
||||
#if QT_CONFIG(harfbuzz)
|
||||
shapingEnabled = QFontEngine::scriptRequiresOpenType(QChar::Script(si.analysis.script))
|
||||
|| (font.d->request.styleStrategy & QFont::PreferNoShaping) == 0;
|
||||
#endif
|
||||
letterSpacingIsAbsolute = font.d->letterSpacingIsAbsolute;
|
||||
letterSpacing = font.d->letterSpacing;
|
||||
wordSpacing = font.d->wordSpacing;
|
||||
|
Loading…
x
Reference in New Issue
Block a user