This commit is contained in:
Behdad Esfahbod 2019-08-28 15:30:37 -07:00
parent 33c8e2303c
commit 23681b6da4
1 changed files with 8 additions and 13 deletions

View File

@ -296,12 +296,11 @@ SingleSubst_serialize (hb_serialize_context_t *c,
struct Sequence struct Sequence
{ {
bool intersects (const hb_set_t *glyphs) const
{ return hb_all (substitute, glyphs); }
void closure (hb_closure_context_t *c) const void closure (hb_closure_context_t *c) const
{ { c->output->add_array (substitute.arrayZ, substitute.len); }
unsigned int count = substitute.len;
for (unsigned int i = 0; i < count; i++)
c->output->add (substitute[i]);
}
void collect_glyphs (hb_collect_glyphs_context_t *c) const void collect_glyphs (hb_collect_glyphs_context_t *c) const
{ c->output->add_array (substitute.arrayZ, substitute.len); } { c->output->add_array (substitute.arrayZ, substitute.len); }
@ -353,7 +352,7 @@ struct Sequence
const hb_set_t &glyphset = *c->plan->glyphset (); const hb_set_t &glyphset = *c->plan->glyphset ();
const hb_map_t &glyph_map = *c->plan->glyph_map; const hb_map_t &glyph_map = *c->plan->glyph_map;
if (!hb_all (substitute, glyphset)) return_trace (false); if (!intersects (&glyphset)) return_trace (false);
auto it = auto it =
+ hb_iter (substitute) + hb_iter (substitute)
@ -528,11 +527,7 @@ struct MultipleSubst
struct AlternateSet struct AlternateSet
{ {
void closure (hb_closure_context_t *c) const void closure (hb_closure_context_t *c) const
{ { c->output->add_array (alternates.arrayZ, alternates.len); }
unsigned int count = alternates.len;
for (unsigned int i = 0; i < count; i++)
c->output->add (alternates[i]);
}
void collect_glyphs (hb_collect_glyphs_context_t *c) const void collect_glyphs (hb_collect_glyphs_context_t *c) const
{ c->output->add_array (alternates.arrayZ, alternates.len); } { c->output->add_array (alternates.arrayZ, alternates.len); }
@ -707,7 +702,7 @@ struct AlternateSubst
struct Ligature struct Ligature
{ {
bool intersects (const hb_set_t *glyphs) const bool intersects (const hb_set_t *glyphs) const
{ return hb_all (hb_iter (component), glyphs); } { return hb_all (component, glyphs); }
void closure (hb_closure_context_t *c) const void closure (hb_closure_context_t *c) const
{ {
@ -791,7 +786,7 @@ struct Ligature
const hb_set_t &glyphset = *c->plan->glyphset (); const hb_set_t &glyphset = *c->plan->glyphset ();
const hb_map_t &glyph_map = *c->plan->glyph_map; const hb_map_t &glyph_map = *c->plan->glyph_map;
if (!glyphset.has (ligGlyph) || !hb_all (component, glyphset)) return_trace (false); if (!intersects (&glyphset) || !glyphset.has (ligGlyph)) return_trace (false);
auto it = auto it =
+ hb_iter (component) + hb_iter (component)