diff --git a/src/hb-subset-glyf.cc b/src/hb-subset-glyf.cc index d7edd750ae5030836080f6c8a567d8d530ba29b9..49c52a9168daf0dd3e9b5d03b8f1bb19d43f919e 100644 --- a/src/hb-subset-glyf.cc +++ b/src/hb-subset-glyf.cc @@ -72,8 +72,9 @@ _write_glyf_and_loca_prime (const OT::glyf::accelerator_t &glyf, hb_codepoint_t next_glyph = -1; hb_codepoint_t new_glyph_id = 0; + unsigned int end_offset; while (hb_set_next(glyph_ids, &next_glyph)) { - unsigned int start_offset, end_offset; + unsigned int start_offset; if (unlikely (!glyf.get_offsets (next_glyph, &start_offset, &end_offset))) { return false; } @@ -86,6 +87,10 @@ _write_glyf_and_loca_prime (const OT::glyf::accelerator_t &glyf, new_glyph_id++; } + // Add the last loca entry which doesn't correspond to a specific glyph + // but identifies the end of the last glyphs data. + loca_prime[new_glyph_id].set(end_offset); + return true; }