fixed CFF1 subset of std encoding & non-std charset combo

This commit is contained in:
Michiharu Ariza 2018-11-15 10:54:15 -08:00
parent 892ab37e7c
commit ecdb77f0ae
3 changed files with 5 additions and 4 deletions

View File

@ -389,13 +389,11 @@ struct Dict : UnsizedByteStr
inline static bool serialize_offset4_op (hb_serialize_context_t *c, OpCode op, int value)
{
if (value == 0) return true;
return serialize_uint4_op (c, op, value);
}
inline static bool serialize_offset2_op (hb_serialize_context_t *c, OpCode op, int value)
{
if (value == 0) return true;
return serialize_uint2_op (c, op, value);
}
};

View File

@ -770,11 +770,13 @@ struct CFF1TopDictOpSet : TopDictOpSet<CFF1TopDictVal>
case OpCode_Encoding:
dictval.EncodingOffset = env.argStack.pop_uint ();
env.clear_args ();
if (unlikely (dictval.EncodingOffset == 0)) return;
break;
case OpCode_charset:
dictval.CharsetOffset = env.argStack.pop_uint ();
env.clear_args ();
if (unlikely (dictval.CharsetOffset == 0)) return;
break;
case OpCode_FDSelect:

View File

@ -735,12 +735,13 @@ struct cff_subset_plan {
final_size += offsets.globalSubrsInfo.size;
/* Encoding */
if (!subset_encoding && acc.is_predef_charset ())
if (!subset_encoding)
offsets.encodingOffset = acc.topDict.EncodingOffset;
else
{
offsets.encodingOffset = final_size;
if (subset_encoding)
final_size += plan_subset_encoding (acc, plan);
}
/* Charset */
if (!subset_charset && acc.is_predef_charset ())