summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-06-19 10:33:30 -0700
committerMatthias Clasen <mclasen@redhat.com>2022-07-04 11:17:20 -0400
commit70eb450beb96f5f1375882c1a90a915845930ff0 (patch)
treeacaef2766ff40565c676f5dca9654f5cdf39c2d4
parent393c7cc641c36029119249ea8c9d3ca2eaecb90b (diff)
downloadpango-70eb450beb96f5f1375882c1a90a915845930ff0.tar.gz
pango-list: Print some more info
-rw-r--r--utils/pango-list.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/utils/pango-list.c b/utils/pango-list.c
index 67070449..31fc6d2c 100644
--- a/utils/pango-list.c
+++ b/utils/pango-list.c
@@ -101,8 +101,10 @@ main (int argc,
gboolean opt_metrics = FALSE;
gboolean opt_variations = FALSE;
gboolean opt_version = FALSE;
+ gboolean opt_only_families = FALSE;
GOptionEntry entries[] = {
{ "verbose", 0, 0, G_OPTION_ARG_NONE, &opt_verbose, "Print verbose information", NULL },
+ { "families", 0, 0, G_OPTION_ARG_NONE, &opt_only_families, "List only families", NULL },
{ "metrics", 0, 0, G_OPTION_ARG_NONE, &opt_metrics, "Print font metrics", NULL },
{ "variations", 0, 0, G_OPTION_ARG_NONE, &opt_variations, "Print font variations", NULL },
{ "version", 0, 0, G_OPTION_ARG_NONE, &opt_version, "Show version" },
@@ -149,14 +151,24 @@ main (int argc,
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (fontmap)); i++)
{
PangoFontFamily *family = g_list_model_get_item (G_LIST_MODEL (fontmap), i);
- const char *kind;
const char *family_name = pango_font_family_get_name (family);
g_object_unref (family);
- kind = "";
+ g_print ("%s", family_name);
- g_print ("%s %s\n", family_name, kind);
+ if (opt_verbose)
+ {
+ if (PANGO_IS_GENERIC_FAMILY (family))
+ g_print ("(generic)");
+
+ g_print (" (%d faces)", g_list_model_get_n_items (G_LIST_MODEL (family)));
+ }
+
+ g_print ("\n");
+
+ if (opt_only_families)
+ continue;
width = 0;
for (j = 0; j < g_list_model_get_n_items (G_LIST_MODEL (family)); j++)