diff --git a/src/hb-limits.hh b/src/hb-limits.hh index 57a1a3163..2cb14a4cc 100644 --- a/src/hb-limits.hh +++ b/src/hb-limits.hh @@ -104,5 +104,9 @@ #define HB_CFF_MAX_OPS 10000 #endif +#ifndef HB_MAX_COMPOSITE_OPERATIONS_PER_GLYPH +#define HB_MAX_COMPOSITE_OPERATIONS_PER_GLYPH 64 +#endif + #endif /* HB_LIMITS_HH */ diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 98ae837f4..37a7fd171 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -795,10 +795,6 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes, } } -#ifndef HB_COMPOSITE_OPERATIONS_PER_GLYPH -#define HB_COMPOSITE_OPERATIONS_PER_GLYPH 64 -#endif - static unsigned _glyf_add_gid_and_children (const OT::glyf_accelerator_t &glyf, hb_codepoint_t gid, @@ -928,7 +924,7 @@ _populate_gids_to_retain (hb_subset_plan_t* plan, if (glyf.has_data ()) for (hb_codepoint_t gid : cur_glyphset) _glyf_add_gid_and_children (glyf, gid, &plan->_glyphset, - cur_glyphset.get_population () * HB_COMPOSITE_OPERATIONS_PER_GLYPH); + cur_glyphset.get_population () * HB_MAX_COMPOSITE_OPERATIONS_PER_GLYPH); else plan->_glyphset.union_ (cur_glyphset); #ifndef HB_NO_SUBSET_CFF