[subset-cff2] Add flush_hintmask

Fixes https://github.com/harfbuzz/harfbuzz/issues/4125
This commit is contained in:
Behdad Esfahbod 2023-02-19 12:14:35 -07:00
parent adccc5355b
commit 2746597b69
1 changed files with 11 additions and 0 deletions

View File

@ -162,6 +162,17 @@ struct cff2_cs_opset_flatten_t : cff2_cs_opset_t<cff2_cs_opset_flatten_t, flatte
}
}
static void flush_hintmask (op_code_t op, cff2_cs_interp_env_t<blend_arg_t> &env, flatten_param_t& param)
{
SUPER::flush_hintmask (op, env, param);
if (!param.drop_hints)
{
str_encoder_t encoder (param.flatStr);
for (unsigned int i = 0; i < env.hintmask_size; i++)
encoder.encode_byte (env.str_ref[i]);
}
}
private:
typedef cff2_cs_opset_t<cff2_cs_opset_flatten_t, flatten_param_t, blend_arg_t> SUPER;
typedef cs_opset_t<blend_arg_t, cff2_cs_opset_flatten_t, cff2_cs_opset_flatten_t, cff2_cs_interp_env_t<blend_arg_t>, flatten_param_t> CSOPSET;