Fix the character index used for getting a glyph attribute in basic shaping
This commit is contained in:
parent
e8f567cf5b
commit
4fe90bb612
1 changed files with 3 additions and 3 deletions
|
|
@ -458,12 +458,12 @@ fn shape_skip(
|
||||||
|
|
||||||
glyphs.extend(
|
glyphs.extend(
|
||||||
line[start_run..end_run]
|
line[start_run..end_run]
|
||||||
.chars()
|
.char_indices()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, codepoint)| {
|
.map(|(i, (chr_idx, codepoint))| {
|
||||||
let glyph_id = charmap.map(codepoint);
|
let glyph_id = charmap.map(codepoint);
|
||||||
let x_advance = glyph_metrics.advance_width(glyph_id);
|
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 {
|
ShapeGlyph {
|
||||||
start: i,
|
start: i,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue