diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 84fa6dcd7..422120949 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -848,6 +848,21 @@ struct KerxTable /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ inline const T* thiz (void) const { return static_cast (this); } + inline bool has_cross_stream (void) const + { + typedef typename T::SubTable SubTable; + + const SubTable *st = &thiz()->firstSubTable; + unsigned int count = thiz()->tableCount; + for (unsigned int i = 0; i < count; i++) + { + if (st->u.header.coverage & st->u.header.CrossStream) + return true; + st = &StructAfter (*st); + } + return false; + } + inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { typedef typename T::SubTable SubTable; diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index 95306ece3..690532e29 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -273,6 +273,15 @@ struct kern inline bool has_data (void) const { return u.version32; } + inline bool has_cross_stream (void) const + { + switch (u.major) { + case 0: return u.ot.has_cross_stream (); + case 1: return u.aat.has_cross_stream (); + default:return false; + } + } + inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { switch (u.major) {