mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Fixed a text shaping issue when there was a font change for the last character of a string
This commit is contained in:
parent
84e850a507
commit
81bc30cc26
|
@ -713,6 +713,9 @@ bool Font::buildShapeSegments(const std::string& text)
|
|||
else if (textCursor == text.length()) {
|
||||
// Last (and possibly only) segment for this text.
|
||||
addSegment = true;
|
||||
// In case the font changed for the last character.
|
||||
if (lastFont != nullptr && lastFont != currGlyph->fontHB)
|
||||
textCursor -= byteLength;
|
||||
}
|
||||
else if (lastFont != nullptr && lastFont != currGlyph->fontHB) {
|
||||
// The font changed, which requires a new segment.
|
||||
|
|
Loading…
Reference in a new issue