[subset] GDEF Variation Store: step 2
do subset based on variation indices collected in step 1
diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc
index 2d58714..232131c 100644
--- a/src/hb-subset-plan.cc
+++ b/src/hb-subset-plan.cc
@@ -30,6 +30,8 @@
#include "hb-ot-cmap-table.hh"
#include "hb-ot-glyf-table.hh"
+#include "hb-ot-layout-gdef-table.hh"
+#include "hb-ot-layout-gpos-table.hh"
#include "hb-ot-cff1-table.hh"
#include "hb-ot-color-colr-table.hh"
#include "hb-ot-var-fvar-table.hh"
@@ -137,7 +139,25 @@
hb_set_t *layout_variation_indices,
hb_map_t *layout_variation_idx_map)
{
- hb_ot_layout_collect_variation_indices (face, glyphset, gpos_lookups, layout_variation_indices, layout_variation_idx_map);
+ hb_blob_ptr_t<OT::GDEF> gdef = hb_sanitize_context_t ().reference_table<OT::GDEF> (face);
+ hb_blob_ptr_t<OT::GPOS> gpos = hb_sanitize_context_t ().reference_table<OT::GPOS> (face);
+
+ if (!gdef->has_data ())
+ {
+ gdef.destroy ();
+ gpos.destroy ();
+ return;
+ }
+ OT::hb_collect_variation_indices_context_t c (layout_variation_indices, glyphset, gpos_lookups);
+ gdef->collect_variation_indices (&c);
+
+ if (hb_ot_layout_has_positioning (face))
+ gpos->collect_variation_indices (&c);
+
+ gdef->remap_layout_variation_indices (layout_variation_indices, layout_variation_idx_map);
+
+ gdef.destroy ();
+ gpos.destroy ();
}
#endif