[librsvg/librsvg-2.40] Use a separate function to set PangoContext font options for testing



commit 4504e3a5fcd5c8f13f536ecbf01ce0962d0a670d
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Jan 4 14:08:26 2017 -0600

    Use a separate function to set PangoContext font options for testing

 rsvg-cairo-draw.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
index 002e90f..c139ebe 100644
--- a/rsvg-cairo-draw.c
+++ b/rsvg-cairo-draw.c
@@ -379,6 +379,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)
 {
@@ -393,10 +403,7 @@ rsvg_cairo_create_pango_context (RsvgDrawingCtx * ctx)
     pango_cairo_context_set_resolution (context, ctx->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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]