[subset] Correct flipped use short computation

This commit is contained in:
Rod Sheeter 2019-05-10 09:32:43 -07:00
parent ab3fe5de2b
commit 14db6512f8
1 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ struct glyf
TRACE_SERIALIZE (this);
// pad glyphs to 2-byte boundaries to permit short loca
HBUINT8 pad;
pad = 0;
+ it
| hb_apply ( [&] (hb_bytes_t glyph) {
glyph.copy(c);
@ -160,7 +160,7 @@ struct glyf
// TODO whats the right way to serialize loca?
// _subset2 will think these bytes are part of glyf if we write to serializer
bool use_short_loca = glyf_padded_size > 131070;
bool use_short_loca = glyf_padded_size <= 131070;
unsigned int loca_prime_size = (c->plan->num_output_glyphs () + 1) * (use_short_loca ? 2 : 4);
char *loca_prime_data = (char *) calloc(1, loca_prime_size);