Skip ad hoc handling of variation selector in font merging

Since we now support emoji parsing, there is no longer any need
for this ad hoc processing of VS-16. The exception is if Qt is
built without the emoji segmenter, in which case we should keep
it for consistency with previous versions.

Task-number: QTBUG-111801
Change-Id: I3e243b9610fe55dda26eba63ac849e6afa22a185
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2024-11-25 16:05:09 +01:00
parent 486bbc7a5b
commit cb26334684

View File

@ -1997,8 +1997,11 @@ int QFontEngineMulti::stringToCMap(const QChar *str, int len,
int glyph_pos = 0;
QStringIterator it(str, str + len);
int lastFallback = -1;
#if defined(QT_NO_EMOJISEGMENTER)
char32_t previousUcs4 = 0;
#endif
int lastFallback = -1;
while (it.hasNext()) {
const char32_t ucs4 = it.peekNext();
@ -2057,6 +2060,7 @@ int QFontEngineMulti::stringToCMap(const QChar *str, int len,
}
}
#if defined(QT_NO_EMOJISEGMENTER)
// For variant-selectors, they are modifiers to the previous character. If we
// end up with different font selections for the selector and the character it
// modifies, we try applying the selector font to the preceding character as well
@ -2095,11 +2099,15 @@ int QFontEngineMulti::stringToCMap(const QChar *str, int len,
}
}
}
#endif
}
it.advance();
++glyph_pos;
#if defined(QT_NO_EMOJISEGMENTER)
previousUcs4 = ucs4;
#endif
}
*nglyphs = glyph_pos;