From b0da2cd0b9c1346b7cda5997fb799e895e34aace Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 6 Nov 2018 11:16:45 -0500 Subject: [PATCH] [kern] Some more --- src/hb-ot-kern-table.hh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index 2f27dcf40..e9d7e3018 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -536,9 +536,6 @@ struct KernSubTableWrapper inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { return thiz()->subtable.get_kerning (left, right, thiz()->format); } - inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const - { return is_simple () && is_horizontal () ? get_kerning (left, right) : 0; } - inline void apply (AAT::hb_aat_apply_context_t *c) const { thiz()->subtable.apply (c, thiz()->format); } @@ -567,9 +564,11 @@ struct KernTable unsigned int count = thiz()->nTables; for (unsigned int i = 0; i < count; i++) { - if (st->is_simple () && st->is_override ()) + if (!st->is_simple () || !st->is_horizontal ()) + continue; + if (st->is_override ()) v = 0; - v += st->get_h_kerning (left, right); + v += st->get_kerning (left, right); st = &StructAfter (*st); } return v;