From 09de94788b3c588542e6f3f50b6d73577dca8456 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 11 Jul 2022 15:08:22 -0600 Subject: [PATCH] [>64k:glyf] Hid composite glyphIndex --- src/OT/glyf/CompositeGlyph.hh | 4 ++++ src/OT/glyf/Glyph.hh | 2 +- src/OT/glyf/SubsetGlyph.hh | 4 ++-- src/hb-subset-plan.cc | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/OT/glyf/CompositeGlyph.hh b/src/OT/glyf/CompositeGlyph.hh index c145beaa4..f0ff8e3e8 100644 --- a/src/OT/glyf/CompositeGlyph.hh +++ b/src/OT/glyf/CompositeGlyph.hh @@ -145,6 +145,10 @@ struct CompositeGlyphRecord } public: + hb_codepoint_t get_gid () const { return glyphIndex; } + void set_gid (hb_codepoint_t gid) { glyphIndex = gid; } + + protected: HBUINT16 flags; HBGlyphID16 glyphIndex; public: diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index c6f2bde91..3efe538f3 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -146,7 +146,7 @@ struct Glyph for (auto &item : get_composite_iterator ()) { comp_points.reset (); - if (unlikely (!glyf_accelerator.glyph_for_gid (item.glyphIndex) + if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ()) .get_points (font, glyf_accelerator, comp_points, phantom_only, depth + 1))) return false; diff --git a/src/OT/glyf/SubsetGlyph.hh b/src/OT/glyf/SubsetGlyph.hh index ebe437204..7ae8fe307 100644 --- a/src/OT/glyf/SubsetGlyph.hh +++ b/src/OT/glyf/SubsetGlyph.hh @@ -42,8 +42,8 @@ struct SubsetGlyph for (auto &_ : Glyph (dest_glyph).get_composite_iterator ()) { hb_codepoint_t new_gid; - if (plan->new_gid_for_old_gid (_.glyphIndex, &new_gid)) - const_cast (_).glyphIndex = new_gid; + if (plan->new_gid_for_old_gid (_.get_gid(), &new_gid)) + const_cast (_).set_gid (new_gid); } if (plan->flags & HB_SUBSET_FLAGS_NO_HINTING) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index a057bb5d6..8bda4b515 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -439,7 +439,7 @@ _glyf_add_gid_and_children (const OT::glyf_accelerator_t &glyf, for (auto item : glyf.glyph_for_gid (gid).get_composite_iterator ()) operation_count = _glyf_add_gid_and_children (glyf, - item.glyphIndex, + item.get_gid (), gids_to_retain, operation_count, depth);