From 27141735c3e8caa807c3528ce9793b8c8f05a556 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 May 2022 15:12:49 -0600 Subject: [PATCH] [subset] Add Coverage::__end__ implementation --- src/hb-ot-layout-common.hh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 4ff377b82..61f897efd 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -1471,6 +1471,7 @@ struct CoverageFormat1 hb_codepoint_t get_glyph () const { return c->glyphArray[i]; } bool operator != (const iter_t& o) const { return i != o.i || c != o.c; } + iter_t __end__ () const { iter_t it; it.init (*c); it.i = c->glyphArray.len; return it; } private: const struct CoverageFormat1 *c; @@ -1630,6 +1631,8 @@ struct CoverageFormat2 return; } } + else + j = 0; return; } coverage++; @@ -1638,6 +1641,14 @@ struct CoverageFormat2 hb_codepoint_t get_glyph () const { return j; } bool operator != (const iter_t& o) const { return i != o.i || j != o.j || c != o.c; } + iter_t __end__ () const + { + iter_t it; + it.init (*c); + it.i = c->rangeRecord.len; + it.j = 0; + return it; + } private: const struct CoverageFormat2 *c; @@ -1828,6 +1839,18 @@ struct Coverage default:return false; } } + iter_t __end__ () const + { + iter_t it = {}; + it.format = format; + switch (format) + { + case 1: it.u.format1 = u.format1.__end__ (); break; + case 2: it.u.format2 = u.format2.__end__ (); break; + default: break; + } + return it; + } private: unsigned int format;