summaryrefslogtreecommitdiff
path: root/pango/fonts.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/fonts.c')
-rw-r--r--pango/fonts.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/pango/fonts.c b/pango/fonts.c
index 99262942..1f0ee626 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -2374,11 +2374,24 @@ pango_font_family_default_is_variable (PangoFontFamily *family)
}
static void
+pango_font_family_default_list_faces (PangoFontFamily *family,
+ PangoFontFace ***faces,
+ int *n_faces)
+{
+ if (faces)
+ *faces = NULL;
+
+ if (n_faces)
+ *n_faces = 0;
+}
+
+static void
pango_font_family_class_init (PangoFontFamilyClass *class G_GNUC_UNUSED)
{
class->is_monospace = pango_font_family_default_is_monospace;
class->is_variable = pango_font_family_default_is_variable;
class->get_face = pango_font_family_real_get_face;
+ class->list_faces = pango_font_family_default_list_faces;
}
static void
@@ -2449,7 +2462,7 @@ pango_font_family_real_get_face (PangoFontFamily *family,
pango_font_family_list_faces (family, &faces, &n_faces);
face = NULL;
- if (name == NULL)
+ if (name == NULL && n_faces > 0)
{
face = faces[0];
}