New kerning API
In the latest ttf-parser
release, the rudimentary glyphs_kerning
API was removed in favor of a more low-level API, based on semi-direct access to the kerning subtables. But I can't send a pull request because owned_ttf_parser
should be updated first, which will break the compilation.
So here is how pair_kerning
should look like now:
let mut kern = 0;
for subtable in self.inner().kerning_subtables() {
if subtable.is_horizontal() && !subtable.is_variable() {
if let Some(value) = subtable.glyphs_kerning(first_id, second_id) {
kern = value;
break;
}
}
}
This is roughly matches the old implementation. It still completely incorrect, but I guess it's fine in your case. Here is how it should like: https://github.com/RazrFalcon/rustybuzz/blob/master/src/kerning.rs