fix CFF2 local subr subsetting

bug exposed by impl change of fdmap
also fixed name of subr_remap_ts as subr_remaps_t
This commit is contained in:
Michiharu Ariza 2019-02-21 16:34:49 -08:00
parent a190140fa4
commit a7b801f6d1
2 changed files with 13 additions and 15 deletions

View File

@ -572,15 +572,15 @@ struct subr_remap_t : hb_map2_t
int bias; int bias;
}; };
struct subr_remap_ts struct subr_remaps_t
{ {
subr_remap_ts () subr_remaps_t ()
{ {
global_remap.init (); global_remap.init ();
local_remaps.init (); local_remaps.init ();
} }
~subr_remap_ts () { fini (); } ~subr_remaps_t () { fini (); }
void init (unsigned int fdCount) void init (unsigned int fdCount)
{ {
@ -996,7 +996,7 @@ struct subr_subsetter_t
parsed_cs_str_vec_t parsed_global_subrs; parsed_cs_str_vec_t parsed_global_subrs;
hb_vector_t<parsed_cs_str_vec_t> parsed_local_subrs; hb_vector_t<parsed_cs_str_vec_t> parsed_local_subrs;
subr_remap_ts remaps; subr_remaps_t remaps;
private: private:
typedef typename SUBRS::count_type subr_count_type; typedef typename SUBRS::count_type subr_count_type;

View File

@ -326,8 +326,7 @@ struct cff2_subset_plan {
{ {
subset_localsubrs[fd].init (); subset_localsubrs[fd].init ();
offsets.localSubrsInfos[fd].init (); offsets.localSubrsInfos[fd].init ();
if (fdmap.has (fd))
{
if (!subr_subsetter.encode_localsubrs (fd, subset_localsubrs[fd])) if (!subr_subsetter.encode_localsubrs (fd, subset_localsubrs[fd]))
return false; return false;
@ -340,7 +339,6 @@ struct cff2_subset_plan {
} }
} }
} }
}
/* global subrs */ /* global subrs */
offsets.globalSubrsInfo.offset = final_size; offsets.globalSubrsInfo.offset = final_size;