[minor] Rewrite set operation in OS/2 subsetting

This patch could be nicer:
https://github.com/harfbuzz/harfbuzz/pull/2572/files

Just tiny touchup now.
This commit is contained in:
Behdad Esfahbod 2021-02-11 12:23:33 -07:00
parent cdb9197b41
commit bbbea3dbd8
1 changed files with 4 additions and 5 deletions

View File

@ -177,15 +177,14 @@ struct OS2
if (!c->plan->glyphs_requested->is_empty ())
{
hb_map_t unicode_glyphid_map;
OT::cmap::accelerator_t cmap;
cmap.init (c->plan->source);
cmap.collect_mapping (&unicodes, &unicode_glyphid_map);
cmap.fini ();
if (c->plan->unicodes->is_empty ()) unicodes.clear ();
else hb_set_set (&unicodes, c->plan->unicodes);
hb_set_set (&unicodes, c->plan->unicodes);
+ unicode_glyphid_map.iter ()
| hb_filter (c->plan->glyphs_requested, hb_second)
| hb_map (hb_first)