[glabels/vala] Embed the text in the printstream as text rather than as outline



commit 9560b0ee9d50390123991ac4cf270695c26de9b2
Author: Jim Evins <evins snaught com>
Date:   Thu May 22 21:43:30 2014 -0400

    Embed the text in the printstream as text rather than as outline
    
    Fixes bug 702783.  Render text directly using pango-cairo API instead of
    filling text outline path.  Based on C patch for same bug, originally
    submitted by James Cloos.

 glabels/label_object_text.vala |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/glabels/label_object_text.vala b/glabels/label_object_text.vala
index 99fa03e..866b613 100644
--- a/glabels/label_object_text.vala
+++ b/glabels/label_object_text.vala
@@ -395,10 +395,8 @@ namespace glabels
 
                private void draw_text_real( Cairo.Context cr, bool in_editor, MergeRecord? record, Color 
color )
                {
-                       set_text_path( cr, in_editor, record );
-
                        cr.set_source_rgba( color.r, color.g, color.b, color.a );
-                       cr.fill();
+                       layout_text( cr, in_editor, record, false );
                }
 
 
@@ -413,7 +411,7 @@ namespace glabels
                                }
                                else
                                {
-                                       set_text_path( cr, true, null);
+                                       layout_text( cr, true, null, true );
                                }
                                if ( cr.in_fill( x, y ) )
                                {
@@ -434,7 +432,10 @@ namespace glabels
                }
 
 
-               private void set_text_path( Cairo.Context cr, bool in_editor, MergeRecord? record )
+               private void layout_text( Cairo.Context cr,
+                                         bool in_editor,
+                                         MergeRecord? record,
+                                         bool path_only )
                {
                        /*
                         * Workaround for pango Bug#700592, which is a regression of Bug#341481.
@@ -502,7 +503,14 @@ namespace glabels
                        }
 
                        cr.move_to( TEXT_MARGIN/scale_x, y );
-                       Pango.cairo_layout_path( cr, layout );
+                       if ( path_only )
+                       {
+                               Pango.cairo_layout_path( cr, layout );
+                       }
+                       else
+                       {
+                               Pango.cairo_show_layout( cr, layout );
+                       }
 
                        cr.restore();
                }


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