diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index 04be9827b..f9aec05e9 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -294,7 +294,7 @@ struct KernTable /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ inline const T* thiz (void) const { return static_cast (this); } - inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right, unsigned int table_length) const + inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { int v = 0; const typename T::SubTableWrapper *st = CastP (&thiz()->dataZ); @@ -303,7 +303,7 @@ struct KernTable { if (st->is_override ()) v = 0; - v += st->get_h_kerning (left, right, table_length + (const char *) this); + v += st->get_h_kerning (left, right, st->length + (const char *) st); st = &StructAfter (*st); } return v; @@ -337,6 +337,7 @@ struct KernOT : KernTable struct SubTableWrapper : KernSubTableWrapper { + friend struct KernTable; friend struct KernSubTableWrapper; enum Coverage @@ -378,6 +379,7 @@ struct KernAAT : KernTable struct SubTableWrapper : KernSubTableWrapper { + friend struct KernTable; friend struct KernSubTableWrapper; enum Coverage @@ -418,11 +420,11 @@ struct kern inline bool has_data (void) const { return u.version32 != 0; } - inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right, unsigned int table_length) const + inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { switch (u.major) { - case 0: return u.ot.get_h_kerning (left, right, table_length); - case 1: return u.aat.get_h_kerning (left, right, table_length); + case 0: return u.ot.get_h_kerning (left, right); + case 1: return u.aat.get_h_kerning (left, right); default:return 0; } } @@ -444,7 +446,6 @@ struct kern { blob = hb_sanitize_context_t().reference_table (face); table = blob->as (); - table_length = blob->length; } inline void fini (void) { @@ -455,7 +456,7 @@ struct kern { return table->has_data (); } inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const - { return table->get_h_kerning (left, right, table_length); } + { return table->get_h_kerning (left, right); } inline int get_kerning (hb_codepoint_t first, hb_codepoint_t second) const { return get_h_kerning (first, second); } @@ -475,7 +476,6 @@ struct kern private: hb_blob_t *blob; const kern *table; - unsigned int table_length; }; protected: