[subset] do colrv1 glyph closure before glyf composite closure.

This commit is contained in:
Garret Rieger 2021-06-18 14:14:20 -07:00 committed by Behdad Esfahbod
parent d07f789ae3
commit 26c80adb61
1 changed files with 11 additions and 10 deletions

View File

@ -291,6 +291,16 @@ _populate_gids_to_retain (hb_subset_plan_t* plan,
cur_glyphset = &glyphset_colrv0; cur_glyphset = &glyphset_colrv0;
} }
hb_set_t palette_indices;
colr.closure_V0palette_indices (cur_glyphset, &palette_indices);
hb_set_t layer_indices;
colr.closure_forV1 (cur_glyphset, &layer_indices, &palette_indices);
_remap_indexes (&layer_indices, plan->colrv1_layers);
_remap_palette_indexes (&palette_indices, plan->colr_palettes);
colr.fini ();
_remove_invalid_gids (cur_glyphset, plan->source->get_num_glyphs ());
// Populate a full set of glyphs to retain by adding all referenced // Populate a full set of glyphs to retain by adding all referenced
// composite glyphs. // composite glyphs.
for (hb_codepoint_t gid : cur_glyphset->iter ()) for (hb_codepoint_t gid : cur_glyphset->iter ())
@ -304,15 +314,6 @@ _populate_gids_to_retain (hb_subset_plan_t* plan,
_remove_invalid_gids (plan->_glyphset, plan->source->get_num_glyphs ()); _remove_invalid_gids (plan->_glyphset, plan->source->get_num_glyphs ());
hb_set_t palette_indices;
colr.closure_V0palette_indices (plan->_glyphset, &palette_indices);
hb_set_t layer_indices;
colr.closure_forV1 (plan->_glyphset, &layer_indices, &palette_indices);
_remap_indexes (&layer_indices, plan->colrv1_layers);
_remap_palette_indexes (&palette_indices, plan->colr_palettes);
colr.fini ();
_remove_invalid_gids (plan->_glyphset, plan->source->get_num_glyphs ());
#ifndef HB_NO_VAR #ifndef HB_NO_VAR
if (close_over_gdef) if (close_over_gdef)