Add an extra entry to the end of the loca table to identify the end of the last glyph's data.
This commit is contained in:
parent
aac7d96212
commit
5a34114f96
|
@ -72,8 +72,9 @@ _write_glyf_and_loca_prime (const OT::glyf::accelerator_t &glyf,
|
||||||
hb_codepoint_t next_glyph = -1;
|
hb_codepoint_t next_glyph = -1;
|
||||||
hb_codepoint_t new_glyph_id = 0;
|
hb_codepoint_t new_glyph_id = 0;
|
||||||
|
|
||||||
|
unsigned int end_offset;
|
||||||
while (hb_set_next(glyph_ids, &next_glyph)) {
|
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))) {
|
if (unlikely (!glyf.get_offsets (next_glyph, &start_offset, &end_offset))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -86,6 +87,10 @@ _write_glyf_and_loca_prime (const OT::glyf::accelerator_t &glyf,
|
||||||
new_glyph_id++;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue