src/hb-shaper-private.hh | 4 ++++ src/hb-subset-plan.cc | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-)
New commits: commit bf90f35302c319ec4699ccbcd1e28b15ef2ec423 Author: Behdad Esfahbod <[email protected]> Date: Tue Jul 24 18:00:14 2018 -0700 [coretext] Add note diff --git a/src/hb-shaper-private.hh b/src/hb-shaper-private.hh index ce2d9f28..3fa53216 100644 --- a/src/hb-shaper-private.hh +++ b/src/hb-shaper-private.hh @@ -97,6 +97,10 @@ HB_SHAPER_DATA_ENSURE_FUNC(shaper, object) (hb_##object##_t *object) \ retry: \ HB_SHAPER_DATA_TYPE (shaper, object) *data = (HB_SHAPER_DATA_TYPE (shaper, object) *) hb_atomic_ptr_get (&HB_SHAPER_DATA (shaper, object)); \ if (likely (data) && !(condition)) { \ + /* Note that evaluating condition above can be dangerous if another thread + * got here first and destructed data. That's, as always, bad use pattern. + * If you modify the font (change font size), other threads must not be + * using it at the same time. */ /* Drop and recreate. */ \ /* If someone dropped it in the mean time, throw it away and don't touch it. \ * Otherwise, destruct it. */ \ commit fb58cb4b5ca7043fa746b1a01790abf53bedfa86 Author: Garret Rieger <[email protected]> Date: Wed Jul 25 13:39:17 2018 -0700 [subset] Only used reachable lookups for gsub closure. diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 55c4e3f6..12566827 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -56,11 +56,15 @@ _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_auto_t<hb_set_t> lookup_indices; + hb_ot_layout_collect_lookups (face, + HB_OT_TAG_GSUB, + nullptr, + nullptr, + nullptr, + &lookup_indices); hb_ot_layout_lookups_substitute_closure (face, - nullptr, + &lookup_indices, gids_to_retain); } _______________________________________________ HarfBuzz mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/harfbuzz
