diff --git a/src/symbol/shaping.ts b/src/symbol/shaping.ts index eb802b9dcdd..772d3923ad0 100644 --- a/src/symbol/shaping.ts +++ b/src/symbol/shaping.ts @@ -310,8 +310,12 @@ function shapeText( const taggedLine = new TaggedString(); // Restore zero-width joiners from temporary strip markers. taggedLine.text = line[0].replace(/\uF8FF/g, '\u200D'); - taggedLine.sectionIndex = line[1]; taggedLine.sections = logicalInput.sections; + let elapsedChars = ''; + for (const char of splitByGraphemeCluster(line[0])) { + taggedLine.sectionIndex.push(line[1][elapsedChars.length]); + elapsedChars += char; + } lines.push(taggedLine); } } else {