From 30058f489a43c39b7bd9278c1e04baf1952bba48 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Wed, 18 Jan 2023 15:23:24 -0800 Subject: [PATCH] [instancer] trim .notdef outline data after recalc bounds If outline data present, we use it to recalc bounds and then trim it accordingly --- src/OT/glyf/Glyph.hh | 4 ++++ src/OT/glyf/glyf.hh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 088854a6a..826cc1cb2 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -187,7 +187,11 @@ struct Glyph // it if (gid == 0 && !(plan->flags & HB_SUBSET_FLAGS_NOTDEF_OUTLINE)) + { type = EMPTY; + dest_start = hb_bytes_t (); + dest_end = hb_bytes_t (); + } //dont compile bytes when pinned at default, just recalculate bounds if (!plan->pinned_at_default) { diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index f3d862b12..84d57ae3a 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -407,7 +407,7 @@ glyf::_populate_subset_glyphs (const hb_subset_plan_t *plan, if (unlikely (new_gid == 0 && !(plan->flags & HB_SUBSET_FLAGS_NOTDEF_OUTLINE)) && - plan->pinned_at_default) + !plan->normalized_coords) subset_glyph.source_glyph = glyf_impl::Glyph (); else {