[pango/simple-fontmap: 18/23] pango-list: Show variable faces




commit c54337ae6b007aa04176bb882a074b1082e79d8e
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 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/utils/pango-list.c b/utils/pango-list.c
index 4a672887..2b59c4e0 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,11 +143,13 @@ 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,
-                   width - (int)strlen (face_name) - (int)strlen (synth_str), "", desc_str);
+          g_print ("  %s%s%s: %*s%s\n", synth_str, variable_str, face_name,
+                   width - (int)strlen (face_name) - (int)strlen (synth_str) - (int)strlen (variable_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]