[pango/simple-fontmap: 3/8] pango-list: Show variable faces




commit 1895525cc6f9daa02a9a2ba53d0d9adb09393374
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]