[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_set_t &glyphset = *c->plan->glyphset_gsub ();
|
||||||
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
||||||
|
|
||||||
|
hb_set_t intersection;
|
||||||
|
(this+coverage).intersected_coverage_glyphs (&glyphset, &intersection);
|
||||||
|
|
||||||
auto it =
|
auto it =
|
||||||
+ hb_iter (glyphset)
|
+ hb_iter (intersection)
|
||||||
| hb_filter (this+coverage)
|
|
||||||
| hb_map_retains_sorting (glyph_map)
|
| hb_map_retains_sorting (glyph_map)
|
||||||
| hb_zip (hb_repeat (values.as_array (valueFormat.get_len ())))
|
| 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 d = deltaGlyphID;
|
||||||
hb_codepoint_t mask = get_mask ();
|
hb_codepoint_t mask = get_mask ();
|
||||||
|
|
||||||
hb_sorted_vector_t<hb_codepoint_t> intersection;
|
hb_set_t intersection;
|
||||||
if (1)
|
(this+coverage).intersected_coverage_glyphs (&glyphset, &intersection);
|
||||||
{
|
|
||||||
/* 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto it =
|
auto it =
|
||||||
+ hb_iter (intersection)
|
+ hb_iter (intersection)
|
||||||
|
|
Loading…
Reference in New Issue