From bd4b040e7f6c34afd811d5b8d37e967f18ffe728 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Jan 2023 11:23:48 -0700 Subject: [PATCH] [shape-plan] Simplify glyphs_requested allocation --- src/hb-ot-cmap-table.hh | 2 +- src/hb-subset-plan.cc | 2 +- src/hb-subset-plan.hh | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 523196fa7..850644901 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -1414,7 +1414,7 @@ struct CmapSubtable switch (format) { case 4: return u.format4.serialize (c, it); case 12: return u.format12.serialize (c, it); - case 14: return u.format14.serialize (c, plan->unicodes, plan->glyphs_requested, plan->glyph_map, base); + case 14: return u.format14.serialize (c, plan->unicodes, &plan->glyphs_requested, plan->glyph_map, base); default: return; } } diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 1a0152c30..6d1ee60f5 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -846,7 +846,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face, plan->name_languages = *input->sets.name_languages; plan->layout_features = *input->sets.layout_features; plan->layout_scripts = *input->sets.layout_scripts; - plan->glyphs_requested = hb_set_copy (input->sets.glyphs); + plan->glyphs_requested = *input->sets.glyphs; plan->drop_tables = *input->sets.drop_tables; plan->no_subset_tables = *input->sets.no_subset_tables; plan->source = hb_face_reference (face); diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh index a73cb76e7..6a0f8a6f6 100644 --- a/src/hb-subset-plan.hh +++ b/src/hb-subset-plan.hh @@ -49,7 +49,6 @@ struct hb_subset_plan_t ~hb_subset_plan_t() { hb_set_destroy (unicodes); - hb_set_destroy (glyphs_requested); hb_face_destroy (source); hb_face_destroy (dest); hb_map_destroy (codepoint_to_glyph); @@ -106,7 +105,7 @@ struct hb_subset_plan_t hb_set_t layout_scripts; //glyph ids requested to retain - hb_set_t *glyphs_requested; + hb_set_t glyphs_requested; // Tables which should not be processed, just pass them through. hb_set_t no_subset_tables;