[>64k:glyf] Hid composite glyphIndex

This commit is contained in:
Behdad Esfahbod 2022-07-11 15:08:22 -06:00
parent df7eebf40a
commit 09de94788b
4 changed files with 8 additions and 4 deletions

View File

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

View File

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

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

View File

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