From 7b36ee404c22495e33c66cc4d755671a16089bdf Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Sep 2014 14:31:43 -0400 Subject: Try to fix the test on build.gnome.org For some reason, the test-layout test does not show the font size when run on build.gnome.org. Try harder to make it use the Cantarell 11 font that I want it to use. --- tests/test-layout.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/test-layout.c') diff --git a/tests/test-layout.c b/tests/test-layout.c index a56cdae8..bed7c4a6 100644 --- a/tests/test-layout.c +++ b/tests/test-layout.c @@ -404,6 +404,7 @@ test_file (const gchar *filename, GString *string) gint ellipsize_at = 0; PangoEllipsizeMode ellipsize = PANGO_ELLIPSIZE_NONE; PangoWrapMode wrap = PANGO_WRAP_WORD; + PangoFontDescription *desc; if (!g_file_get_contents (filename, &contents, &length, &error)) { @@ -420,6 +421,11 @@ test_file (const gchar *filename, GString *string) parse_params (contents, &width, &ellipsize_at, &ellipsize, &wrap); layout = pango_layout_new (context); + + desc = pango_font_description_from_string ("Cantarell 11"); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + pango_layout_set_markup (layout, markup, length); g_free (contents); @@ -497,7 +503,6 @@ main (int argc, char *argv[]) GError *error = NULL; const gchar *name; gchar *path; - PangoFontDescription *desc; g_setenv ("LC_ALL", "C", TRUE); setlocale (LC_ALL, ""); @@ -505,9 +510,6 @@ main (int argc, char *argv[]) g_test_init (&argc, &argv, NULL); context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); - desc = pango_font_description_from_string ("Cantarell 11"); - pango_context_set_font_description (context, desc); - pango_font_description_free (desc); /* allow to easily generate expected output for new test cases */ if (argc > 1) -- cgit v1.2.1