diff --git a/util/hb-info.cc b/util/hb-info.cc index 9fa6c0b78..efb5a21dc 100644 --- a/util/hb-info.cc +++ b/util/hb-info.cc @@ -512,9 +512,13 @@ struct info_t { separator (); printf ("Name information:\n\n"); - printf ("Id Text\n------------\n"); + printf ("Id Text\n------------------------------------\n"); } +#ifdef HB_HAS_GOBJECT + GEnumClass *enum_class = (GEnumClass *) g_type_class_ref ((GType) HB_GOBJECT_TYPE_OT_NAME_ID_PREDEFINED); +#endif + unsigned count; const auto *entries = hb_ot_name_list_names (face, &count); for (unsigned i = 0; i < count; i++) @@ -525,7 +529,15 @@ struct info_t language, &name_len, name); - printf ("%u %s\n", entries[i].name_id, name); +#ifdef HB_HAS_GOBJECT + if (verbose) + { + GEnumValue *enum_value = g_enum_get_value (enum_class, entries[i].name_id); + printf ("%u: %-27s %s\n", entries[i].name_id, enum_value ? enum_value->value_nick : "", name); + } + else +#endif + printf ("%u %s\n", entries[i].name_id, name); } } diff --git a/util/meson.build b/util/meson.build index ff38bd635..af40d3ec5 100644 --- a/util/meson.build +++ b/util/meson.build @@ -44,8 +44,8 @@ if conf.get('HAVE_GLIB', 0) == 1 hb_info = executable('hb-info', hb_info_sources, cpp_args: cpp_args, include_directories: [incconfig, incsrc], - dependencies: util_deps, - link_with: [libharfbuzz], + dependencies: [util_deps, gobject_dep], + link_with: [libharfbuzz, libharfbuzz_gobject], install: true, ) meson.override_find_program('hb-info', hb_info) diff --git a/util/options.hh b/util/options.hh index efce20c3a..a376a5670 100644 --- a/util/options.hh +++ b/util/options.hh @@ -46,12 +46,18 @@ #endif +#include #include #include +#ifdef HB_HAS_GOBJECT +#include +#endif + #include #include + static inline void fail (hb_bool_t suggest_help, const char *format, ...) G_GNUC_NORETURN G_GNUC_PRINTF (2, 3); static inline void