From db039d97ff991deecbdffb034b23f4ce086fa562 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 25 Jun 2022 19:06:27 -0600 Subject: [PATCH] [glyf/Composite] Make glyphIndex public --- src/OT/glyf/CompositeGlyph.hh | 5 +---- src/OT/glyf/Glyph.hh | 2 +- src/OT/glyf/SubsetGlyph.hh | 4 ++-- src/hb-subset-plan.cc | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/OT/glyf/CompositeGlyph.hh b/src/OT/glyf/CompositeGlyph.hh index d8ef90014..c145beaa4 100644 --- a/src/OT/glyf/CompositeGlyph.hh +++ b/src/OT/glyf/CompositeGlyph.hh @@ -47,9 +47,6 @@ struct CompositeGlyphRecord return size; } - void set_glyph_index (hb_codepoint_t new_gid) { glyphIndex = new_gid; } - hb_codepoint_t get_glyph_index () const { return glyphIndex; } - void drop_instructions_flag () { flags = (uint16_t) flags & ~WE_HAVE_INSTRUCTIONS; } void set_overlaps_flag () { @@ -147,7 +144,7 @@ struct CompositeGlyphRecord return tx || ty; } - protected: + public: HBUINT16 flags; HBGlyphID16 glyphIndex; public: diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 5aac0f882..2bb7984f7 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -142,7 +142,7 @@ struct Glyph for (auto &item : get_composite_iterator ()) { contour_point_vector_t comp_points; - if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_glyph_index ()) + if (unlikely (!glyf_accelerator.glyph_for_gid (item.glyphIndex) .get_points (font, glyf_accelerator, comp_points, phantom_only, depth + 1) || comp_points.length < PHANTOM_COUNT)) diff --git a/src/OT/glyf/SubsetGlyph.hh b/src/OT/glyf/SubsetGlyph.hh index 124a39054..ebe437204 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 (_.get_glyph_index (), &new_gid)) - const_cast (_).set_glyph_index (new_gid); + if (plan->new_gid_for_old_gid (_.glyphIndex, &new_gid)) + const_cast (_).glyphIndex = 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 78aaf4877..7a0baecab 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -368,7 +368,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.get_glyph_index (), + item.glyphIndex, gids_to_retain, operation_count, depth);