fixed FDSelect size calcluation

This commit is contained in:
Michiharu Ariza 2018-11-02 16:40:20 -07:00
parent 481fdfdc23
commit 34b06d994a
3 changed files with 4 additions and 4 deletions

View File

@ -632,7 +632,7 @@ struct FDSelect3_4 {
FDSelect3_4_Range<GID_TYPE, FD_TYPE> ranges[VAR];
/* GID_TYPE sentinel */
DEFINE_SIZE_ARRAY (GID_TYPE::static_size * 2, ranges);
DEFINE_SIZE_ARRAY (GID_TYPE::static_size, ranges);
};
typedef FDSelect3_4<HBUINT16, HBUINT8> FDSelect3;

View File

@ -112,14 +112,14 @@ hb_plan_subset_cff_fdselect (const hb_vector_t<hb_codepoint_t> &glyphs,
{
assert (src.format == 4);
subset_fdselect_format = 4;
subset_fdselect_size = FDSelect4::min_size + FDSelect4_Range::static_size * num_ranges + HBUINT32::static_size;
subset_fdselect_size = FDSelect::min_size + FDSelect4::min_size + FDSelect4_Range::static_size * num_ranges + HBUINT32::static_size;
}
else
{
#if CFF_SERIALIZE_FDSELECT_0
unsigned int format0_size = FDSelect0::min_size + HBUINT8::static_size * subset_num_glyphs;
unsigned int format0_size = FDSelect::min_size + FDSelect0::min_size + HBUINT8::static_size * subset_num_glyphs;
#endif
unsigned int format3_size = FDSelect3::min_size + FDSelect3_Range::static_size * num_ranges + HBUINT16::static_size;
unsigned int format3_size = FDSelect::min_size + FDSelect3::min_size + FDSelect3_Range::static_size * num_ranges + HBUINT16::static_size;
#if CFF_SERIALIZE_FDSELECT_0
if (format0_size <= format3_size)