Use a separate function to set PangoContext font options for testing

parent 9cf19654
......@@ -371,6 +371,16 @@ get_font_options_for_testing (void)
return options;
}
static void
set_font_options_for_testing (PangoContext *context)
{
cairo_font_options_t *font_options;
font_options = get_font_options_for_testing ();
pango_cairo_context_set_font_options (context, font_options);
cairo_font_options_destroy (font_options);
}
PangoContext *
rsvg_cairo_create_pango_context (RsvgDrawingCtx * ctx)
{
......@@ -387,10 +397,7 @@ rsvg_cairo_create_pango_context (RsvgDrawingCtx * ctx)
pango_cairo_context_set_resolution (context, dpi_y);
if (ctx->is_testing) {
cairo_font_options_t *font_options;
font_options = get_font_options_for_testing ();
pango_cairo_context_set_font_options (context, font_options);
cairo_font_options_destroy (font_options);
set_font_options_for_testing (context);
}
return context;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment