[hb-info] Add --get-meta
diff --git a/util/hb-info.cc b/util/hb-info.cc
index e707840..030adb6 100644
--- a/util/hb-info.cc
+++ b/util/hb-info.cc
@@ -107,6 +107,7 @@
{"get-style", 0, 0, G_OPTION_ARG_STRING_ARRAY,&this->get_style, "Get style", "style tag; eg. 'wght'"},
{"get-metric", 0, 0, G_OPTION_ARG_STRING_ARRAY,&this->get_metric, "Get metric", "metric tag; eg. 'hasc'"},
{"get-baseline", 0, 0, G_OPTION_ARG_STRING_ARRAY,&this->get_baseline, "Get baseline", "baseline tag; eg. 'hang'"},
+ {"get-meta", 0, 0, G_OPTION_ARG_STRING_ARRAY,&this->get_meta, "Get meta information", "tag tag; eg. 'dlng'"},
{"get-table", 0, 0, G_OPTION_ARG_STRING, &this->get_table, "Get font table", "table tag; eg. 'cmap'"},
{"list-all", 0, 0, G_OPTION_ARG_NONE, &this->list_all, "List all long information", nullptr},
@@ -202,6 +203,7 @@
char **get_style = nullptr;
char **get_metric = nullptr;
char **get_baseline = nullptr;
+ char **get_meta = nullptr;
char *get_table = nullptr;
hb_bool_t list_all = false;
@@ -309,6 +311,7 @@
if (get_style) _get_style ();
if (get_metric) _get_metric ();
if (get_baseline) _get_baseline ();
+ if (get_meta) _get_meta ();
if (get_table) _get_table ();
if (list_names) _list_names ();
@@ -576,6 +579,25 @@
}
}
+ void _get_meta ()
+ {
+ for (char **p = get_meta; *p; p++)
+ {
+ hb_ot_meta_tag_t tag = (hb_ot_meta_tag_t) hb_tag_from_string (*p, -1);
+
+ hb_blob_t *blob = hb_ot_meta_reference_entry (face, tag);
+
+ if (verbose)
+ printf ("Meta %c%c%c%c: ", HB_UNTAG (tag));
+
+ printf ("%.*s\n",
+ (int) hb_blob_get_length (blob),
+ hb_blob_get_data (blob, nullptr));
+
+ hb_blob_destroy (blob);
+ }
+ }
+
void
_get_table ()
{