diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c
index fcd250befd..0ada0f6a3e 100644
--- a/gtk/gtkcssshorthandpropertyimpl.c
+++ b/gtk/gtkcssshorthandpropertyimpl.c
@@ -1143,8 +1143,18 @@ pack_font_description (GtkCssShorthandProperty *shorthand,
v = (* query_func) (GTK_CSS_PROPERTY_FONT_FAMILY, query_data);
if (v)
{
- /* xxx: Can we set all the families here somehow? */
- pango_font_description_set_family (description, _gtk_css_string_value_get (_gtk_css_array_value_get_nth (v, 0)));
+ int i;
+ GString *s = g_string_new ("");
+
+ for (i = 0; i < _gtk_css_array_value_get_n_values (v); i++)
+ {
+ if (i > 0)
+ g_string_append (s, ",");
+ g_string_append (s, _gtk_css_string_value_get (_gtk_css_array_value_get_nth (v, i)));
+ }
+
+ pango_font_description_set_family (description, s->str);
+ g_string_free (s, TRUE);
}
v = (* query_func) (GTK_CSS_PROPERTY_FONT_SIZE, query_data);
diff --git a/testsuite/reftests/label-fonts.css b/testsuite/reftests/label-fonts.css
new file mode 100644
index 0000000000..aa44addd77
--- /dev/null
+++ b/testsuite/reftests/label-fonts.css
@@ -0,0 +1,3 @@
+* {
+ font-family: nonexisting,Sans;
+}
diff --git a/testsuite/reftests/label-fonts.ref.ui b/testsuite/reftests/label-fonts.ref.ui
new file mode 100644
index 0000000000..b00757eeb8
--- /dev/null
+++ b/testsuite/reftests/label-fonts.ref.ui
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/testsuite/reftests/label-fonts.ui b/testsuite/reftests/label-fonts.ui
new file mode 100644
index 0000000000..b00757eeb8
--- /dev/null
+++ b/testsuite/reftests/label-fonts.ui
@@ -0,0 +1,11 @@
+
+
+
+ popup
+
+
+ abcdefg
+
+
+
+
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 9845b42e06..44dbc487e7 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -267,6 +267,9 @@ testdata = [
'label-ellipsize-small.ui',
'label-ellipsize-with-big.ref.ui',
'label-ellipsize-with-big.ui',
+ 'label-fonts.css',
+ 'label-fonts.ref.ui',
+ 'label-fonts.ui',
'label-shadows.css',
'label-shadows.ref.ui',
'label-shadows.ui',