diff --git a/util/font-options.hh b/util/font-options.hh index 0f13ddd3a..fa1cffa86 100644 --- a/util/font-options.hh +++ b/util/font-options.hh @@ -83,6 +83,7 @@ static struct supported_font_funcs_t { void font_options_t::post_parse (GError **error) { + assert (!font); font = hb_font_create (face); if (font_size_x == FONT_SIZE_UPEM) @@ -272,7 +273,8 @@ font_options_t::add_options (option_parser_t *parser) "font", "Font-instance options:", "Options for the font instance", - this); + this, + false /* We add below. */); const gchar *variations_help = "Comma-separated list of font variations\n" "\n" diff --git a/util/options.hh b/util/options.hh index acb341fcb..790650bfd 100644 --- a/util/options.hh +++ b/util/options.hh @@ -110,12 +110,14 @@ struct option_parser_t const gchar *name, const gchar *description, const gchar *help_description, - Type *closure) + Type *closure, + bool add_parse_hooks = true) { GOptionGroup *group = g_option_group_new (name, description, help_description, static_cast(closure), nullptr); g_option_group_add_entries (group, entries); - g_option_group_set_parse_hooks (group, nullptr, post_parse); + if (add_parse_hooks) + g_option_group_set_parse_hooks (group, nullptr, post_parse); g_option_context_add_group (context, group); }