Skip to content

Commit

Permalink
Fixed section index after bidi processing
Browse files Browse the repository at this point in the history
  • Loading branch information
1ec5 committed Aug 23, 2024
1 parent be2d95e commit 1eae64b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/symbol/shaping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1eae64b

Please sign in to comment.