|
|
|
@ -745,8 +745,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
objidx_t subrs_link = 0; |
|
|
|
|
if (plan.subset_localsubrs[i].length > 0) |
|
|
|
|
{ |
|
|
|
|
CFF1Subrs *dest = c->start_embed <CFF1Subrs> (); |
|
|
|
|
if (unlikely (!dest)) return false; |
|
|
|
|
auto *dest = c->start_embed <CFF1Subrs> (); |
|
|
|
|
c->push (); |
|
|
|
|
if (likely (dest && dest->serialize (c, plan.subset_localsubrs[i]))) |
|
|
|
|
subrs_link = c->pop_pack (); |
|
|
|
@ -757,8 +756,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PrivateDict *pd = c->start_embed<PrivateDict> (); |
|
|
|
|
if (unlikely (!pd)) return false; |
|
|
|
|
auto *pd = c->start_embed<PrivateDict> (); |
|
|
|
|
c->push (); |
|
|
|
|
cff1_private_dict_op_serializer_t privSzr (plan.desubroutinize, plan.drop_hints); |
|
|
|
|
/* N.B. local subrs immediately follows its corresponding private dict. i.e., subr offset == private dict size */ |
|
|
|
@ -787,9 +785,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
if (unlikely (!c->start_zerocopy (total_size))) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
CFF1CharStrings *cs = c->start_embed<CFF1CharStrings> (); |
|
|
|
|
if (unlikely (!cs)) return false; |
|
|
|
|
|
|
|
|
|
auto *cs = c->start_embed<CFF1CharStrings> (); |
|
|
|
|
if (likely (cs->serialize (c, plan.subset_charstrings))) |
|
|
|
|
plan.info.char_strings_link = c->pop_pack (false); |
|
|
|
|
else |
|
|
|
@ -802,8 +798,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
/* FDArray (FD Index) */ |
|
|
|
|
if (acc.fdArray != &Null (CFF1FDArray)) |
|
|
|
|
{ |
|
|
|
|
CFF1FDArray *fda = c->start_embed<CFF1FDArray> (); |
|
|
|
|
if (unlikely (!fda)) return false; |
|
|
|
|
auto *fda = c->start_embed<CFF1FDArray> (); |
|
|
|
|
c->push (); |
|
|
|
|
cff1_font_dict_op_serializer_t fontSzr; |
|
|
|
|
auto it = + hb_zip (+ hb_iter (plan.fontdicts_mod), + hb_iter (plan.fontdicts_mod)); |
|
|
|
@ -834,8 +829,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
/* Charset */ |
|
|
|
|
if (plan.subset_charset) |
|
|
|
|
{ |
|
|
|
|
Charset *dest = c->start_embed<Charset> (); |
|
|
|
|
if (unlikely (!dest)) return false; |
|
|
|
|
auto *dest = c->start_embed<Charset> (); |
|
|
|
|
c->push (); |
|
|
|
|
if (likely (dest->serialize (c, |
|
|
|
|
plan.subset_charset_format, |
|
|
|
@ -852,8 +846,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
/* Encoding */ |
|
|
|
|
if (plan.subset_encoding) |
|
|
|
|
{ |
|
|
|
|
Encoding *dest = c->start_embed<Encoding> (); |
|
|
|
|
if (unlikely (!dest)) return false; |
|
|
|
|
auto *dest = c->start_embed<Encoding> (); |
|
|
|
|
c->push (); |
|
|
|
|
if (likely (dest->serialize (c, |
|
|
|
|
plan.subset_enc_format, |
|
|
|
@ -871,8 +864,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
/* global subrs */ |
|
|
|
|
{ |
|
|
|
|
c->push (); |
|
|
|
|
CFF1Subrs *dest = c->start_embed <CFF1Subrs> (); |
|
|
|
|
if (unlikely (!dest)) return false; |
|
|
|
|
auto *dest = c->start_embed <CFF1Subrs> (); |
|
|
|
|
if (likely (dest->serialize (c, plan.subset_globalsubrs))) |
|
|
|
|
c->pop_pack (false); |
|
|
|
|
else |
|
|
|
@ -884,8 +876,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
|
|
|
|
|
/* String INDEX */ |
|
|
|
|
{ |
|
|
|
|
CFF1StringIndex *dest = c->start_embed<CFF1StringIndex> (); |
|
|
|
|
if (unlikely (!dest)) return false; |
|
|
|
|
auto *dest = c->start_embed<CFF1StringIndex> (); |
|
|
|
|
c->push (); |
|
|
|
|
if (likely (dest->serialize (c, *acc.stringIndex, plan.sidmap))) |
|
|
|
|
c->pop_pack (); |
|
|
|
@ -912,8 +903,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
/* top dict INDEX */ |
|
|
|
|
{ |
|
|
|
|
/* serialize singleton TopDict */ |
|
|
|
|
TopDict *top = c->start_embed<TopDict> (); |
|
|
|
|
if (!top) return false; |
|
|
|
|
auto *top = c->start_embed<TopDict> (); |
|
|
|
|
c->push (); |
|
|
|
|
cff1_top_dict_op_serializer_t topSzr; |
|
|
|
|
unsigned top_size = 0; |
|
|
|
@ -929,8 +919,7 @@ static bool _serialize_cff1 (hb_serialize_context_t *c, |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
/* serialize INDEX header for above */ |
|
|
|
|
CFF1Index *dest = c->start_embed<CFF1Index> (); |
|
|
|
|
if (!dest) return false; |
|
|
|
|
auto *dest = c->start_embed<CFF1Index> (); |
|
|
|
|
return dest->serialize_header (c, hb_iter (hb_array_t<unsigned> (&top_size, 1))); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|