diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index d4e82249d..0fc66d2cb 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2308,11 +2308,13 @@ struct ClassDef template - bool serialize (hb_serialize_context_t *c, Iterator it) + bool serialize (hb_serialize_context_t *c, Iterator it_with_class_zero) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); + auto it = + it_with_class_zero | hb_filter (hb_second); + unsigned format = 2; if (likely (it)) { @@ -2328,8 +2330,8 @@ struct ClassDef { hb_codepoint_t cur_gid = gid_klass_pair.first; unsigned cur_klass = gid_klass_pair.second; - if (cur_klass) num_glyphs++; - if (cur_gid == glyph_min || !cur_klass) continue; + num_glyphs++; + if (cur_gid == glyph_min) continue; if (cur_gid > glyph_max) glyph_max = cur_gid; if (cur_gid != prev_gid + 1 || cur_klass != prev_klass)