Fix indexing for RTL
This commit is contained in:
parent
a867d4520a
commit
8068557468
1 changed files with 13 additions and 4 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue