[pango/variable-face: 29/29] Skip variable when enumerating faces



commit 08d32d958fe73398696cd4b0d5c36f9a78f55aff
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Oct 15 16:08:19 2018 -0400

    Skip variable when enumerating faces
    
    The variable face is somewhat special, and we don't want
    to confuse things by calling it 'Regular' (since it doesn't
    have a style).

 pango/pangofc-fontmap.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 9075535c..7d75f6f9 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -2556,6 +2556,16 @@ pango_fc_family_list_faces (PangoFontFamily  *family,
              if (FcPatternGetInteger(fontset->fonts[i], FC_SLANT, 0, &slant) != FcResultMatch)
                slant = FC_SLANT_ROMAN;
 
+#ifdef FC_VARIABLE
+              {
+                gboolean variable;
+                if (FcPatternGetBool(fontset->fonts[i], FC_VARIABLE, 0, &variable) != FcResultMatch)
+                  variable = FALSE;
+                if (variable) /* skip the variable face */
+                  continue;
+              }
+#endif
+
              if (FcPatternGetString (fontset->fonts[i], FC_STYLE, 0, (FcChar8 **)(void*)&font_style) != 
FcResultMatch)
                font_style = NULL;
 


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