[glyf/Composite] Make glyphIndex public

This commit is contained in:
Behdad Esfahbod 2022-06-25 19:06:27 -06:00
parent 1b14bf8aa8
commit db039d97ff
4 changed files with 5 additions and 8 deletions

View File

@ -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:

View File

@ -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))

View File

@ -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<CompositeGlyphRecord &> (_).set_glyph_index (new_gid);
if (plan->new_gid_for_old_gid (_.glyphIndex, &new_gid))
const_cast<CompositeGlyphRecord &> (_).glyphIndex = new_gid;
}
if (plan->flags & HB_SUBSET_FLAGS_NO_HINTING)

View File

@ -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);