diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc index 56a2bba522d..5c0983b7160 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc @@ -30,6 +30,7 @@ #include "hb-ot-cmap-table.hh" #include "hb-ot-glyf-table.hh" +#include "hb-ot-cff1-table.hh" static void _add_gid_and_children (const OT::glyf::accelerator_t &glyf, @@ -53,6 +54,19 @@ _add_gid_and_children (const OT::glyf::accelerator_t &glyf, } static void +_add_cff_seac_components (const OT::cff1::accelerator_t &cff, + hb_codepoint_t gid, + hb_set_t *gids_to_retain) +{ + hb_codepoint_t base_gid, accent_gid; + if (cff.get_seac_components (gid, &base_gid, &accent_gid)) + { + hb_set_add (gids_to_retain, base_gid); + hb_set_add (gids_to_retain, accent_gid); + } +} + +static void _gsub_closure (hb_face_t *face, hb_set_t *gids_to_retain) { hb_set_t lookup_indices; @@ -89,8 +103,10 @@ _populate_gids_to_retain (hb_face_t *face, { OT::cmap::accelerator_t cmap; OT::glyf::accelerator_t glyf; + OT::cff1::accelerator_t cff; cmap.init (face); glyf.init (face); + cff.init (face); hb_set_t *initial_gids_to_retain = hb_set_create (); initial_gids_to_retain->add (0); // Not-def @@ -120,6 +136,8 @@ _populate_gids_to_retain (hb_face_t *face, while (initial_gids_to_retain->next (&gid)) { _add_gid_and_children (glyf, gid, all_gids_to_retain); + if (cff.is_valid ()) + _add_cff_seac_components (cff, gid, all_gids_to_retain); } hb_set_destroy (initial_gids_to_retain); @@ -130,6 +148,7 @@ _populate_gids_to_retain (hb_face_t *face, while (all_gids_to_retain->next (&gid)) glyphs->push (gid); + cff.fini (); glyf.fini (); cmap.fini (); @@ -163,6 +182,7 @@ hb_subset_plan_create (hb_face_t *face, plan->drop_hints = input->drop_hints; plan->drop_layout = input->drop_layout; + plan->desubroutinize = input->desubroutinize; plan->unicodes = hb_set_create(); plan->glyphs.init(); plan->source = hb_face_reference (face); |