Skip to content

Commit

Permalink
Support reverse chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed May 21, 2024
1 parent 1614539 commit f6bc7ad
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/formats/opentype/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,26 @@ impl Characters for opentype::tables::glyph_substitution::Type {
values.insert(backward_value);
}
}
Type::ReverseChainedContextualSubstibution(_) => {}
Type::ReverseChainedContextualSubstibution(value) => {
if let (Some(mut backward_value), Some(value), Some(forward_value)) = (
value
.backward_coverages
.iter()
.rev()
.map(|coverage| coverage.compress(mapping))
.collect::<Option<Vec<_>>>(),
value.coverage.compress(mapping),
value
.forward_coverages
.iter()
.map(|coverage| coverage.compress(mapping))
.collect::<Option<Vec<_>>>(),
) {
backward_value.push(value);
backward_value.extend(forward_value);
values.insert(backward_value);
}
}
_ => {}
}
values
Expand Down

0 comments on commit f6bc7ad

Please sign in to comment.