[post] Add MVAR to subsetting

This commit is contained in:
Behdad Esfahbod 2023-01-11 14:25:37 -07:00
parent 9dc3e785aa
commit f455000138
1 changed files with 12 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#define HB_OT_POST_TABLE_HH
#include "hb-open-type.hh"
#include "hb-ot-var-mvar-table.hh"
#define HB_STRING_ARRAY_NAME format1_names
#define HB_STRING_ARRAY_LIST "hb-ot-post-macroman.hh"
@ -98,6 +99,17 @@ struct post
post *post_prime = c->serializer->start_embed<post> ();
if (unlikely (!post_prime)) return_trace (false);
#ifndef HB_NO_VAR
if (c->plan->normalized_coords)
{
auto &MVAR = *c->plan->source->table.MVAR;
auto *table = post_prime;
HB_ADD_MVAR_VAR (HB_OT_METRICS_TAG_UNDERLINE_SIZE, underlineThickness);
HB_ADD_MVAR_VAR (HB_OT_METRICS_TAG_UNDERLINE_OFFSET, underlinePosition);
}
#endif
bool glyph_names = c->plan->flags & HB_SUBSET_FLAGS_GLYPH_NAMES;
if (!serialize (c->serializer, glyph_names))
return_trace (false);