From f4550001380bf1c8f70119908d83538d4bafb918 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Jan 2023 14:25:37 -0700 Subject: [PATCH] [post] Add MVAR to subsetting --- src/hb-ot-post-table.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hb-ot-post-table.hh b/src/hb-ot-post-table.hh index a1ee14587..e0eb77094 100644 --- a/src/hb-ot-post-table.hh +++ b/src/hb-ot-post-table.hh @@ -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 (); 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);