[hb-info] Move some initialization to post_parse

This commit is contained in:
Behdad Esfahbod 2023-01-22 10:07:24 -07:00
parent 334f59c955
commit 752ad51cce
1 changed files with 12 additions and 7 deletions

View File

@ -116,7 +116,7 @@ struct info_t
"Query options:", "Query options:",
"Options to query the font instance", "Options to query the font instance",
this, this,
false); true);
} }
protected: protected:
@ -171,13 +171,9 @@ struct info_t
public: public:
template <typename app_t> void
void operator () (app_t *app) post_parse (GError **error)
{ {
blob = hb_blob_reference (((font_options_t *) app)->blob);
face = hb_face_reference (((font_options_t *) app)->face);
font = hb_font_reference (((font_options_t *) app)->font);
verbose = !app->quiet;
if (direction_str) if (direction_str)
direction = hb_direction_from_string (direction_str, -1); direction = hb_direction_from_string (direction_str, -1);
if (script_str) if (script_str)
@ -185,6 +181,15 @@ struct info_t
language = hb_language_get_default (); language = hb_language_get_default ();
if (language_str) if (language_str)
language = hb_language_from_string (language_str, -1); language = hb_language_from_string (language_str, -1);
}
template <typename app_t>
void operator () (app_t *app)
{
blob = hb_blob_reference (((font_options_t *) app)->blob);
face = hb_face_reference (((font_options_t *) app)->face);
font = hb_font_reference (((font_options_t *) app)->font);
verbose = !app->quiet;
if (all) if (all)
{ {