ensure fdmap initialized as identity for single-FD (non-CID) fonts
This commit is contained in:
parent
b403be8ad9
commit
b6903bd6c4
|
@ -647,8 +647,9 @@ struct cff_subset_plan {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine re-mapping of font index as fdmap among other info */
|
/* Determine re-mapping of font index as fdmap among other info */
|
||||||
if (acc.fdSelect != &Null(CFF1FDSelect)
|
if (acc.fdSelect != &Null(CFF1FDSelect))
|
||||||
&& unlikely (!hb_plan_subset_cff_fdselect (plan->glyphs,
|
{
|
||||||
|
if (unlikely (!hb_plan_subset_cff_fdselect (plan->glyphs,
|
||||||
orig_fdcount,
|
orig_fdcount,
|
||||||
*acc.fdSelect,
|
*acc.fdSelect,
|
||||||
subset_fdcount,
|
subset_fdcount,
|
||||||
|
@ -657,6 +658,9 @@ struct cff_subset_plan {
|
||||||
subset_fdselect_ranges,
|
subset_fdselect_ranges,
|
||||||
fdmap)))
|
fdmap)))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fdmap.identity (1);
|
||||||
|
|
||||||
/* remove unused SIDs & reassign SIDs */
|
/* remove unused SIDs & reassign SIDs */
|
||||||
{
|
{
|
||||||
|
@ -790,7 +794,10 @@ struct cff_subset_plan {
|
||||||
unsigned int priv_size = PrivateDict::calculate_serialized_size (acc.privateDicts[i], privSzr, has_localsubrs);
|
unsigned int priv_size = PrivateDict::calculate_serialized_size (acc.privateDicts[i], privSzr, has_localsubrs);
|
||||||
TableInfo privInfo = { final_size, priv_size, 0 };
|
TableInfo privInfo = { final_size, priv_size, 0 };
|
||||||
FontDictValuesMod fontdict_mod;
|
FontDictValuesMod fontdict_mod;
|
||||||
fontdict_mod.init ( &acc.fontDicts[i], sidmap[acc.fontDicts[i].fontName], privInfo );
|
if (!acc.is_CID ())
|
||||||
|
fontdict_mod.init ( &Null(CFF1FontDictValues), CFF_UNDEF_SID, privInfo );
|
||||||
|
else
|
||||||
|
fontdict_mod.init ( &acc.fontDicts[i], sidmap[acc.fontDicts[i].fontName], privInfo );
|
||||||
fontdicts_mod.push (fontdict_mod);
|
fontdicts_mod.push (fontdict_mod);
|
||||||
final_size += privInfo.size;
|
final_size += privInfo.size;
|
||||||
|
|
||||||
|
|
|
@ -356,6 +356,8 @@ struct cff2_subset_plan {
|
||||||
|
|
||||||
final_size += offsets.FDSelectInfo.size;
|
final_size += offsets.FDSelectInfo.size;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
fdmap.identity (1);
|
||||||
|
|
||||||
/* FDArray (FDIndex) */
|
/* FDArray (FDIndex) */
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue