mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-25 21:10:10 +01:00
[test] Minor tweak of ft-text-vertical-layout
Tidily destroy the font immediately after use.
This commit is contained in:
parent
bdd3c5ba69
commit
7c499db8af
2 changed files with 4 additions and 7 deletions
|
|
@ -125,6 +125,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
}
|
||||
|
||||
cairo_set_scaled_font (cr, scaled_font);
|
||||
cairo_scaled_font_destroy (scaled_font);
|
||||
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
cairo_set_source_rgb (cr, 0, 0, 0); /* black */
|
||||
|
|
@ -154,16 +155,13 @@ draw (cairo_t *cr, int width, int height)
|
|||
extents.height + line_width);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_scaled_font_destroy (scaled_font);
|
||||
|
||||
return CAIRO_TEST_SUCCESS;
|
||||
}
|
||||
|
||||
CAIRO_TEST (ft_text_vertical_layout_type1,
|
||||
"Tests text rendering for vertical layout with Type1 fonts"
|
||||
"\nCan fail if an incorrect font is loaded---need to bundle the desired font",
|
||||
"ft, text", /* keywords */
|
||||
"ft, fc, text", /* keywords */
|
||||
NULL, /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, draw)
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
}
|
||||
|
||||
cairo_set_scaled_font (cr, scaled_font);
|
||||
cairo_scaled_font_destroy (scaled_font);
|
||||
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
cairo_set_source_rgb (cr, 0, 0, 0); /* black */
|
||||
|
|
@ -154,14 +155,12 @@ draw (cairo_t *cr, int width, int height)
|
|||
extents.height + line_width);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_scaled_font_destroy (scaled_font);
|
||||
|
||||
return CAIRO_TEST_SUCCESS;
|
||||
}
|
||||
|
||||
CAIRO_TEST (ft_text_vertical_layout_type3,
|
||||
"Tests text rendering for vertical layout with TrueType fonts",
|
||||
"ft, text", /* keywords */
|
||||
"ft, fc, text", /* keywords */
|
||||
NULL, /* requirements */
|
||||
WIDTH, HEIGHT,
|
||||
NULL, draw)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue