Merge branch 'font-families' into 'master'
Font families Closes #1854 See merge request GNOME/gtk!813
This commit is contained in:
@@ -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);
|
||||
|
||||
3
testsuite/reftests/label-fonts.css
Normal file
3
testsuite/reftests/label-fonts.css
Normal file
@@ -0,0 +1,3 @@
|
||||
* {
|
||||
font-family: nonexisting,Sans;
|
||||
}
|
||||
11
testsuite/reftests/label-fonts.ref.ui
Normal file
11
testsuite/reftests/label-fonts.ref.ui
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="type">popup</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="label" translatable="yes">abcdefg</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
11
testsuite/reftests/label-fonts.ui
Normal file
11
testsuite/reftests/label-fonts.ui
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="type">popup</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="label" translatable="yes">abcdefg</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user