Skip to content

Commit

Permalink
Fix the character index used for getting a glyph attribute in basic s…
Browse files Browse the repository at this point in the history
…haping
  • Loading branch information
dekrain authored and jackpot51 committed Sep 23, 2024
1 parent e8f567c commit 4fe90bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,12 @@ fn shape_skip(

glyphs.extend(
line[start_run..end_run]
.chars()
.char_indices()
.enumerate()
.map(|(i, codepoint)| {
.map(|(i, (chr_idx, codepoint))| {
let glyph_id = charmap.map(codepoint);
let x_advance = glyph_metrics.advance_width(glyph_id);
let attrs = attrs_list.get_span(i);
let attrs = attrs_list.get_span(start_run + chr_idx);

ShapeGlyph {
start: i,
Expand Down

0 comments on commit 4fe90bb

Please sign in to comment.