summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2015-04-16 11:59:02 +0200
committerAndrea Canciani <ranma42@gmail.com>2015-07-27 12:45:59 +0200
commite1353f3b859d28dc3f5a9d4fb4496085240a8c68 (patch)
treef23737d6dc0d1fbfc7b725505f5d01dbce7d7a93
parent6951fb4238706522d357fd25236b17492baea1b0 (diff)
test: Always use DejaVu Sans as default font
This makes the results of the test suite more stable across different environments, because it does not rely anymore on CAIRO_FONT_FAMILY_DEFAULT (which on Windows is "Arial", on Mac "Helvetica"). This change should not affect Linux environments, assuming that the default font is already set to "DejaVu Sans".
-rw-r--r--test/cairo-test.c4
-rw-r--r--test/clip-zero.c2
-rw-r--r--test/pthread-show-text.c4
-rw-r--r--test/show-glyphs-many.c2
-rw-r--r--test/text-cache-crash.c4
-rw-r--r--test/user-font-proxy.c2
6 files changed, 11 insertions, 7 deletions
diff --git a/test/cairo-test.c b/test/cairo-test.c
index a351b0174..6f8cb7917 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -915,6 +915,10 @@ REPEAT:
cairo_paint (cr);
cairo_restore (cr);
+ cairo_select_font_face (cr, CAIRO_TEST_FONT_FAMILY " Sans",
+ CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_WEIGHT_NORMAL);
+
/* Set all components of font_options to avoid backend differences
* and reduce number of needed reference images. */
font_options = cairo_font_options_create ();
diff --git a/test/clip-zero.c b/test/clip-zero.c
index 5afd1b561..302b2b161 100644
--- a/test/clip-zero.c
+++ b/test/clip-zero.c
@@ -46,7 +46,7 @@ draw (cairo_t *cr, int width, int height)
cairo_stroke_preserve (cr);
cairo_paint (cr);
- cairo_select_font_face (cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
+ cairo_select_font_face (cr, CAIRO_TEST_FONT_FAMILY " Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_show_text (cr, "ABC");
cairo_mask (cr, cairo_get_source (cr));
diff --git a/test/pthread-show-text.c b/test/pthread-show-text.c
index 0e070b7b7..0f076cb61 100644
--- a/test/pthread-show-text.c
+++ b/test/pthread-show-text.c
@@ -63,7 +63,7 @@ draw_thread (void *arg)
cairo_paint (cr);
cairo_set_source_rgb (cr, 0, 0, 0);
- cairo_select_font_face (cr, "serif",
+ cairo_select_font_face (cr, CAIRO_TEST_FONT_FAMILY " Serif",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, NUM_ITERATIONS);
@@ -74,7 +74,7 @@ draw_thread (void *arg)
for (i = 0; i < NUM_ITERATIONS; i++) {
char buf[2];
- cairo_select_font_face (cr, "serif",
+ cairo_select_font_face (cr, CAIRO_TEST_FONT_FAMILY " Serif",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, i);
diff --git a/test/show-glyphs-many.c b/test/show-glyphs-many.c
index f689fe080..e16282cf5 100644
--- a/test/show-glyphs-many.c
+++ b/test/show-glyphs-many.c
@@ -126,7 +126,7 @@ draw (cairo_t *cr, int width, int height)
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr);
- cairo_select_font_face (cr, "Sans",
+ cairo_select_font_face (cr, CAIRO_TEST_FONT_FAMILY " Sans",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, TEXT_SIZE);
diff --git a/test/text-cache-crash.c b/test/text-cache-crash.c
index 4786af4d5..27fe8cb42 100644
--- a/test/text-cache-crash.c
+++ b/test/text-cache-crash.c
@@ -66,11 +66,11 @@ static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
/* Once there was a bug that choked when selecting the same font twice. */
- cairo_select_font_face (cr, "sans",
+ cairo_select_font_face (cr, CAIRO_TEST_FONT_FAMILY " Sans",
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 40.0);
- cairo_select_font_face (cr, "sans",
+ cairo_select_font_face (cr, CAIRO_TEST_FONT_FAMILY " Sans",
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 40.0);
cairo_move_to (cr, 10, 50);
diff --git a/test/user-font-proxy.c b/test/user-font-proxy.c
index 6a39d8ed8..e4063f0eb 100644
--- a/test/user-font-proxy.c
+++ b/test/user-font-proxy.c
@@ -127,7 +127,7 @@ _user_font_face_create (cairo_font_face_t **out)
/* This also happens to be default font face on cairo_t, so does
* not make much sense here. For demonstration only.
*/
- fallback_font_face = cairo_toy_font_face_create ("",
+ fallback_font_face = cairo_toy_font_face_create (CAIRO_TEST_FONT_FAMILY " Sans",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);