From 8f84c58a34e07254d89eb539ff4dd5ec8089281e Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Fri, 26 Aug 2022 08:24:19 -0700 Subject: [PATCH] [instance] don't copy phantom points from component No need to consider USE_MY_METRICS for instancing --- src/OT/glyf/Glyph.hh | 7 ++++--- src/OT/glyf/glyf.hh | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 10ede2f86..afcb5dc83 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -148,7 +148,7 @@ struct Glyph hb_bytes_t &dest_end /* OUT */) const { contour_point_vector_t all_points, deltas; - get_points (font, glyf, all_points, &deltas); + get_points (font, glyf, all_points, &deltas, false); switch (type) { case COMPOSITE: @@ -182,6 +182,7 @@ struct Glyph bool get_points (hb_font_t *font, const accelerator_t &glyf_accelerator, contour_point_vector_t &all_points /* OUT */, contour_point_vector_t *deltas = nullptr, /* OUT */ + bool use_my_metrics = true, bool phantom_only = false, unsigned int depth = 0) const { @@ -270,11 +271,11 @@ struct Glyph comp_points.reset (); if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ()) .get_points (font, glyf_accelerator, comp_points, - deltas, phantom_only, depth + 1))) + deltas, use_my_metrics, phantom_only, depth + 1))) return false; /* Copy phantom points from component if USE_MY_METRICS flag set */ - if (item.is_use_my_metrics ()) + if (use_my_metrics && item.is_use_my_metrics ()) for (unsigned int i = 0; i < PHANTOM_COUNT; i++) phantoms[i] = comp_points[comp_points.length - PHANTOM_COUNT + i]; diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index 7ba2b8eb0..be2cb1d0d 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -180,7 +180,7 @@ struct glyf_accelerator_t contour_point_vector_t all_points; bool phantom_only = !consumer.is_consuming_contour_points (); - if (unlikely (!glyph_for_gid (gid).get_points (font, *this, all_points, nullptr, phantom_only))) + if (unlikely (!glyph_for_gid (gid).get_points (font, *this, all_points, nullptr, true, phantom_only))) return false; if (consumer.is_consuming_contour_points ())