[pango/pango2: 282/301] pango-list: Print some more info




commit b63fb23132bb31e6200b0d8a03d914dcc1297b65
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 19 10:33:30 2022 -0700

    pango-list: Print some more info

 utils/pango-list.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/utils/pango-list.c b/utils/pango-list.c
index 670704494..31fc6d2c0 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++)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]