Use a separate function to set PangoContext font options for testing

parent 9cf19654
...@@ -371,6 +371,16 @@ get_font_options_for_testing (void) ...@@ -371,6 +371,16 @@ get_font_options_for_testing (void)
return options; 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 * PangoContext *
rsvg_cairo_create_pango_context (RsvgDrawingCtx * ctx) rsvg_cairo_create_pango_context (RsvgDrawingCtx * ctx)
{ {
...@@ -387,10 +397,7 @@ 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); pango_cairo_context_set_resolution (context, dpi_y);
if (ctx->is_testing) { if (ctx->is_testing) {
cairo_font_options_t *font_options; set_font_options_for_testing (context);
font_options = get_font_options_for_testing ();
pango_cairo_context_set_font_options (context, font_options);
cairo_font_options_destroy (font_options);
} }
return 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