summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-01-10 12:36:15 +0000
committerMatthias Clasen <mclasen@redhat.com>2022-01-10 12:36:15 +0000
commit523f0cd58d6ef400e23c3862854c241932669da0 (patch)
tree534102b20dd20aace46c8e5696f6b31d235d619c
parent86569043ad626edf9c8d856376696b63f6094060 (diff)
parent807b2f90766aff183f1239b553ac7df50e98306b (diff)
downloadpango-523f0cd58d6ef400e23c3862854c241932669da0.tar.gz
Merge branch 'matthiasc/for-main' into 'main'
Matthiasc/for main See merge request GNOME/pango!576
-rw-r--r--pango/fonts.c15
-rw-r--r--tests/fonts/DejaVuSans-Bold.ttfbin0 -> 705684 bytes
-rw-r--r--tests/fonts/README1
3 files changed, 15 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];
}
diff --git a/tests/fonts/DejaVuSans-Bold.ttf b/tests/fonts/DejaVuSans-Bold.ttf
new file mode 100644
index 00000000..970a0412
--- /dev/null
+++ b/tests/fonts/DejaVuSans-Bold.ttf
Binary files differ
diff --git a/tests/fonts/README b/tests/fonts/README
index 5faba25d..1a57e614 100644
--- a/tests/fonts/README
+++ b/tests/fonts/README
@@ -3,6 +3,7 @@ test-layout tests.
Cantarell-VF.otf: Cantarell
DejaVSans.ttf: DejaVu Sans
+DejaVSans-Bold.ttf: DejaVu Sans Bold
DejaVSansMono.ttf: DejaVu Sans Mono
emoji-subset.ttf: subset of Noto Color Emoji
droid-sans-subset.ttf: subset of Droid Sans Japanese