librsvg r1200 - trunk



Author: doml
Date: Thu Feb 19 23:24:00 2009
New Revision: 1200
URL: http://svn.gnome.org/viewvc/librsvg?rev=1200&view=rev

Log:
2009-02-19  liucougar <liucougar gmail com>

        * rsvg-text.c: librsvg can not render text-decoration=underline text. Bug #566365
        * rsvg-cairo-draw.c: ditto



Modified:
   trunk/ChangeLog
   trunk/rsvg-cairo-draw.c
   trunk/rsvg-text.c

Modified: trunk/rsvg-cairo-draw.c
==============================================================================
--- trunk/rsvg-cairo-draw.c	(original)
+++ trunk/rsvg-cairo-draw.c	Thu Feb 19 23:24:00 2009
@@ -490,11 +490,9 @@
     bbox.h = ink.height / (double)PANGO_SCALE;
     bbox.virgin = 0;
 
+    if (state->fill) {
     cairo_move_to (render->cr, x, y);
-
     rsvg_bbox_insert (&render->bbox, &bbox);
-
-    if (state->fill) {
         _set_source_rsvg_paint_server (ctx,
                                        state->current_color,
                                        state->fill,
@@ -505,6 +503,8 @@
     }
 
     if (state->stroke) {
+        cairo_move_to (render->cr, x, y);
+        rsvg_bbox_insert (&render->bbox, &bbox);
         pango_cairo_layout_path (render->cr, layout);
 
         _set_source_rsvg_paint_server (ctx,

Modified: trunk/rsvg-text.c
==============================================================================
--- trunk/rsvg-text.c	(original)
+++ trunk/rsvg-text.c	Thu Feb 19 23:24:00 2009
@@ -551,6 +551,22 @@
     attribute->start_index = 0;
     attribute->end_index = G_MAXINT;
     pango_attr_list_insert (attr_list, attribute); 
+
+    if (state->has_font_decor && text) {
+        if (state->font_decor & TEXT_UNDERLINE) {
+            attribute = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
+            attribute->start_index = 0;
+            attribute->end_index = -1;
+            pango_attr_list_insert (attr_list, attribute);
+        }
+	if (state->font_decor & TEXT_STRIKE) {
+            attribute = pango_attr_strikethrough_new (TRUE);
+            attribute->start_index = 0;
+            attribute->end_index = -1;
+            pango_attr_list_insert (attr_list, attribute);
+	}
+    }
+
     pango_layout_set_attributes (layout, attr_list);
     pango_attr_list_unref (attr_list);
 



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