[subset/GSUB/GPOS] Use more intersected_coverage_glyphs()
This commit is contained in:
parent
450d834679
commit
d0eb273791
|
@ -104,9 +104,11 @@ struct SinglePosFormat1
|
|||
const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
|
||||
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
||||
|
||||
hb_set_t intersection;
|
||||
(this+coverage).intersected_coverage_glyphs (&glyphset, &intersection);
|
||||
|
||||
auto it =
|
||||
+ hb_iter (glyphset)
|
||||
| hb_filter (this+coverage)
|
||||
+ hb_iter (intersection)
|
||||
| hb_map_retains_sorting (glyph_map)
|
||||
| hb_zip (hb_repeat (values.as_array (valueFormat.get_len ())))
|
||||
;
|
||||
|
|
|
@ -135,38 +135,8 @@ struct SingleSubstFormat1_3
|
|||
hb_codepoint_t d = deltaGlyphID;
|
||||
hb_codepoint_t mask = get_mask ();
|
||||
|
||||
hb_sorted_vector_t<hb_codepoint_t> intersection;
|
||||
if (1)
|
||||
{
|
||||
/* Walk the coverage and set together, to bail out when the
|
||||
* coverage iterator runs over the end of glyphset. Otherwise,
|
||||
* the coverage may cover many glyphs and we spend a lot of
|
||||
* time here. Other subtables don't have this problem because
|
||||
* they zip coverage iterator with some array... */
|
||||
auto c_iter = hb_iter (this+coverage);
|
||||
auto s_iter = hb_iter (glyphset);
|
||||
while (c_iter && s_iter)
|
||||
{
|
||||
hb_codepoint_t cv = *c_iter;
|
||||
hb_codepoint_t sv = *s_iter;
|
||||
if (cv == sv)
|
||||
{
|
||||
intersection.push (cv);
|
||||
c_iter++;
|
||||
s_iter++;
|
||||
}
|
||||
else if (cv < sv)
|
||||
c_iter++;
|
||||
else
|
||||
s_iter++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
+ hb_iter (this+coverage)
|
||||
| hb_filter (glyphset)
|
||||
| hb_sink (intersection);
|
||||
}
|
||||
hb_set_t intersection;
|
||||
(this+coverage).intersected_coverage_glyphs (&glyphset, &intersection);
|
||||
|
||||
auto it =
|
||||
+ hb_iter (intersection)
|
||||
|
|
Loading…
Reference in New Issue