diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-06-15 04:38:41 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-06-15 04:38:41 +0000 |
commit | 355b4e5dc0f07541a7603df5f55f71a695efac0e (patch) | |
tree | 8bbeca1ce735daad723d233f3c9e07a8b74d9ead /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-plan.cc | |
parent | 098cc2296d980a8010ae5af080098957ffea72c5 (diff) |
harfbuzz 1.8.1
git-svn-id: svn://tug.org/texlive/trunk@48018 c570f23f-e606-0410-a88d-b1316a301751
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 | 21 |
1 files changed, 19 insertions, 2 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 7100efc87c8..55c4e3f6193 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 @@ -54,8 +54,21 @@ _add_gid_and_children (const OT::glyf::accelerator_t &glyf, } static void +_gsub_closure (hb_face_t *face, hb_set_t *gids_to_retain) +{ + // TODO(grieger): This uses all lookups, instead collect + // the set of lookups that are relevant. + // See fontTools implementation. + hb_ot_layout_lookups_substitute_closure (face, + nullptr, + gids_to_retain); +} + + +static void _populate_gids_to_retain (hb_face_t *face, const hb_set_t *unicodes, + bool close_over_gsub, hb_set_t *unicodes_to_retain, hb_map_t *codepoint_to_glyph, hb_vector_t<hb_codepoint_t> *glyphs) @@ -82,10 +95,12 @@ _populate_gids_to_retain (hb_face_t *face, initial_gids_to_retain->add (gid); } + if (close_over_gsub) + // Add all glyphs needed for GSUB substitutions. + _gsub_closure (face, initial_gids_to_retain); + // Populate a full set of glyphs to retain by adding all referenced // composite glyphs. - // TODO expand with glyphs reached by G* - hb_codepoint_t gid = HB_SET_VALUE_INVALID; hb_set_t *all_gids_to_retain = hb_set_create (); while (initial_gids_to_retain->next (&gid)) @@ -131,6 +146,7 @@ hb_subset_plan_create (hb_face_t *face, hb_subset_plan_t *plan = hb_object_create<hb_subset_plan_t> (); plan->drop_hints = input->drop_hints; + plan->drop_ot_layout = input->drop_ot_layout; plan->unicodes = hb_set_create(); plan->glyphs.init(); plan->source = hb_face_reference (face); @@ -140,6 +156,7 @@ hb_subset_plan_create (hb_face_t *face, _populate_gids_to_retain (face, input->unicodes, + !plan->drop_ot_layout, plan->unicodes, plan->codepoint_to_glyph, &plan->glyphs); |