diff options
-rw-r--r-- | pango/fonts.c | 22 | ||||
-rw-r--r-- | pango/pango-font.h | 4 |
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 */ |