summaryrefslogtreecommitdiff
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
parente9336a0a28774395f43ebd9271f2efc332300084 (diff)
downloadpango-dfd0b55960b518b533b7a10c3ac14b1847e9dcfb.tar.gz
Add a variable family API
pango_font_family_is_variable() return whether a font family supports font variations.
-rw-r--r--pango/fonts.c22
-rw-r--r--pango/pango-font.h4
2 files changed, 25 insertions, 1 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
*/
diff --git a/pango/pango-font.h b/pango/pango-font.h
index 4af31a95..1b85c386 100644
--- a/pango/pango-font.h
+++ b/pango/pango-font.h
@@ -409,6 +409,8 @@ PANGO_AVAILABLE_IN_ALL
const char *pango_font_family_get_name (PangoFontFamily *family) G_GNUC_PURE;
PANGO_AVAILABLE_IN_1_4
gboolean pango_font_family_is_monospace (PangoFontFamily *family) G_GNUC_PURE;
+PANGO_AVAILABLE_IN_1_44
+gboolean pango_font_family_is_variable (PangoFontFamily *family) G_GNUC_PURE;
#ifdef PANGO_ENABLE_BACKEND
@@ -442,13 +444,13 @@ struct _PangoFontFamilyClass
int *n_faces);
const char * (*get_name) (PangoFontFamily *family);
gboolean (*is_monospace) (PangoFontFamily *family);
+ gboolean (*is_variable) (PangoFontFamily *family);
/*< private >*/
/* Padding for future expansion */
void (*_pango_reserved2) (void);
void (*_pango_reserved3) (void);
- void (*_pango_reserved4) (void);
};
#endif /* PANGO_ENABLE_BACKEND */