Skip to content

Commit 4fe90bb

Browse files
dekrainjackpot51
authored andcommitted
Fix the character index used for getting a glyph attribute in basic shaping
1 parent e8f567c commit 4fe90bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/shape.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,12 @@ fn shape_skip(
458458

459459
glyphs.extend(
460460
line[start_run..end_run]
461-
.chars()
461+
.char_indices()
462462
.enumerate()
463-
.map(|(i, codepoint)| {
463+
.map(|(i, (chr_idx, codepoint))| {
464464
let glyph_id = charmap.map(codepoint);
465465
let x_advance = glyph_metrics.advance_width(glyph_id);
466-
let attrs = attrs_list.get_span(i);
466+
let attrs = attrs_list.get_span(start_run + chr_idx);
467467

468468
ShapeGlyph {
469469
start: i,

0 commit comments

Comments
 (0)