[pango/simple-fontmap: 17/22] pango-list: Show variable faces




commit a69c9e99c381b2bdc2735130600c9a90c064db0f
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Dec 29 12:55:43 2021 -0500

    pango-list: Show variable faces
    
    Add an '@' to the face name for variable faces.

 utils/pango-list.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/utils/pango-list.c b/utils/pango-list.c
index 4a672887..39aa6adc 100644
--- a/utils/pango-list.c
+++ b/utils/pango-list.c
@@ -133,7 +133,9 @@ main (int    argc,
          const char *face_name = pango_font_face_get_face_name (faces[j]);
          gboolean is_synth = pango_font_face_is_synthesized (faces[j]);
          const char *synth_str = is_synth ? "*" : "";
-          width = MAX (width, strlen (synth_str) + strlen (face_name));
+          gboolean is_variable = pango_font_face_is_variable (faces[j]);
+         const char *variable_str = is_variable ? "@" : "";
+          width = MAX (width, strlen (synth_str) + strlen (variable_str) + strlen (face_name));
         }
 
       for (j = 0; j < n_faces; j++)
@@ -141,10 +143,12 @@ main (int    argc,
          const char *face_name = pango_font_face_get_face_name (faces[j]);
          gboolean is_synth = pango_font_face_is_synthesized (faces[j]);
          const char *synth_str = is_synth ? "*" : "";
+          gboolean is_variable = pango_font_face_is_variable (faces[j]);
+         const char *variable_str = is_variable ? "@" : "";
          PangoFontDescription *desc = pango_font_face_describe (faces[j]);
          char *desc_str = pango_font_description_to_string (desc);
 
-         g_print ("  %s%s: %*s%s\n", synth_str, face_name,
+         g_print ("  %s%s%s: %*s%s\n", synth_str, variable_str, face_name,
                    width - (int)strlen (face_name) - (int)strlen (synth_str), "", desc_str);
 
           pango_font_description_set_absolute_size (desc, 10 * PANGO_SCALE);


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