summaryrefslogtreecommitdiff
path: root/gtk/gtkcssshorthandpropertyimpl.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-05-03 01:18:42 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-05-03 01:44:02 +0000
commit1c9a486d608af5475162768f707d36386bed5e3c (patch)
tree2ac529e33deb77bb96a7080328a67625cb2999dd /gtk/gtkcssshorthandpropertyimpl.c
parenteb9284e9ca2e49791d218ac69796cf86d9e90604 (diff)
downloadgtk+-1c9a486d608af5475162768f707d36386bed5e3c.tar.gz
css: Use multiple font-family values
Pango API to support this, so we can implement this very easily. Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1854
Diffstat (limited to 'gtk/gtkcssshorthandpropertyimpl.c')
-rw-r--r--gtk/gtkcssshorthandpropertyimpl.c14
1 files changed, 12 insertions, 2 deletions
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);