mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 07:00:08 +01:00
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".
This commit is contained in:
parent
6951fb4238
commit
e1353f3b85
6 changed files with 11 additions and 7 deletions
|
|
@ -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 ();
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue