[pango] Try to fix the test on build.gnome.org
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] Try to fix the test on build.gnome.org
- Date: Sat, 6 Sep 2014 18:32:44 +0000 (UTC)
commit 7b36ee404c22495e33c66cc4d755671a16089bdf
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Sep 6 14:31:43 2014 -0400
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 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/tests/test-layout.c b/tests/test-layout.c
index a56cdae..bed7c4a 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]