[pango/variable-face: 14/15] font-list: print out family details



commit 37daf4ea2ade57210264fb24eed8bbea12a64d37
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Oct 15 16:01:33 2018 -0400

    font-list: print out family details
    
    Show if a family is monospace or variable,
    mainly to prove that the APIs work.

 utils/pango-list.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/utils/pango-list.c b/utils/pango-list.c
index cb92767e..6f80b521 100644
--- a/utils/pango-list.c
+++ b/utils/pango-list.c
@@ -46,9 +46,25 @@ main (int    argc,
     {
       PangoFontFace **faces;
       int n_faces;
+      const char *kind;
 
       const char *family_name = pango_font_family_get_name (families[i]);
-      g_print ("%s\n", family_name);
+      if (pango_font_family_is_monospace (families[i]))
+        {
+          if (pango_font_family_is_variable (families[i]))
+            kind = "(monospace, variable)";
+          else
+            kind = "(monospace)";
+        }
+      else
+        {
+          if (pango_font_family_is_variable (families[i]))
+            kind = "(variable)";
+          else
+            kind = "";
+        }
+
+      g_print ("%s %s\n", family_name, kind);
 
       pango_font_family_list_faces (families[i], &faces, &n_faces);
       for (j = 0; j < n_faces; j++)


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