Fix indexing for RTL

This commit is contained in:
Jeremy Soller 2022-10-04 15:14:21 -06:00
parent a867d4520a
commit 8068557468
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE

View file

@ -190,10 +190,19 @@ impl<'a> FontMatches<'a> {
} }
// Adjust end of glyphs // Adjust end of glyphs
for i in (1..glyphs.len()).rev() { match direction {
if glyphs[i - 1].start == glyphs[i].start { rustybuzz::Direction::LeftToRight => {
glyphs[i - 1].end = glyphs[i].end; for i in 1..glyphs.len() {
} glyphs[i - 1].end = glyphs[i].start;
}
},
rustybuzz::Direction::RightToLeft => {
for i in 1..glyphs.len() {
glyphs[i].end = glyphs[i - 1].start;
}
},
//TODO: other directions
_ => (),
} }
let span = FontShapeSpan { let span = FontShapeSpan {