summaryrefslogtreecommitdiff
path: root/pango/fonts.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-10-15 16:00:45 -0400
committerMatthias Clasen <mclasen@redhat.com>2018-11-19 16:20:01 -0500
commitdfd0b55960b518b533b7a10c3ac14b1847e9dcfb (patch)
tree6c45a884c556f9dee2d602122e05d93d6d60b233 /pango/fonts.c
parente9336a0a28774395f43ebd9271f2efc332300084 (diff)
downloadpango-dfd0b55960b518b533b7a10c3ac14b1847e9dcfb.tar.gz
Add a variable family API
pango_font_family_is_variable() return whether a font family supports font variations.
Diffstat (limited to 'pango/fonts.c')
-rw-r--r--pango/fonts.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/pango/fonts.c b/pango/fonts.c
index d9a07c0b..63e7c7b9 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -2147,6 +2147,28 @@ pango_font_family_is_monospace (PangoFontFamily *family)
return FALSE;
}
+/**
+ * pango_font_family_is_variable:
+ * @family: a #PangoFontFamily
+ *
+ * A variable font is a font which has axes that can be modified to
+ * produce different faces.
+ *
+ * Return value: %TRUE if the family is variable
+ *
+ * Since: 1.44
+ **/
+gboolean
+pango_font_family_is_variable (PangoFontFamily *family)
+{
+ g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), FALSE);
+
+ if (PANGO_FONT_FAMILY_GET_CLASS (family)->is_variable)
+ return PANGO_FONT_FAMILY_GET_CLASS (family)->is_variable (family);
+ else
+ return FALSE;
+}
+
/*
* PangoFontFace
*/