]> git.sur5r.net Git - glabels/commitdiff
2006-05-22 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Mon, 22 May 2006 23:55:04 +0000 (23:55 +0000)
committerJim Evins <evins@snaught.com>
Mon, 22 May 2006 23:55:04 +0000 (23:55 +0000)
* src/print.c: (draw_text_object):
Check shadow state when printing text.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@590 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/ChangeLog
glabels2/src/print.c

index c058dc978f47f95da2de9e5dce6f39ba28fd84e9..be4023919dddc50e4117c896b9cec8c528fc7f98 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-22  Jim Evins  <evins@snaught.com>
+
+       * src/print.c: (draw_text_object):
+               Check shadow state when printing text.
+
 2006-05-20  Jim Evins  <evins@snaught.com>
 
        * src/ui-commands.c: (gl_ui_cmd_view_grid_toggle),
index 5ef1e8046641c24336c53489e823368597f34b83..bdbe574be5b8bf3b94e344d4bbcebb7ae8a8f095 100644 (file)
@@ -839,55 +839,58 @@ draw_text_object (PrintInfo     *pi,
                                       font_size);
        gnome_print_setfont (pi->pc, font);
 
-       gnome_print_setrgbcolor (pi->pc,
-                                GL_COLOR_F_RED (shadow_color),
-                                GL_COLOR_F_GREEN (shadow_color),
-                                GL_COLOR_F_BLUE (shadow_color));
-       gnome_print_setopacity (pi->pc, GL_COLOR_F_ALPHA (shadow_color));
-
-       for (i = 0; line[i] != NULL; i++) {
-
-               glyphlist = gnome_glyphlist_from_text_dumb (font, color,
-                                                           0.0, 0.0,
-                                                           (guchar *)line[i]);
-
-               gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox);
-               w = bbox.x1;
-               gnome_glyphlist_unref (glyphlist);
-
-               switch (just) {
-               case GTK_JUSTIFY_LEFT:
-                       x_offset = GL_LABEL_TEXT_MARGIN;
-                       break;
-               case GTK_JUSTIFY_CENTER:
-                       x_offset = (object_w - GL_LABEL_TEXT_MARGIN - w) / 2.0;
-                       break;
-               case GTK_JUSTIFY_RIGHT:
-                       x_offset = object_w - GL_LABEL_TEXT_MARGIN - w;
-                       break;
-               default:
-                       x_offset = 0.0;
-                       break;  /* shouldn't happen */
-               }
-                x_offset += shadow_x;
-
-               /* Work out the y position to the BOTTOM of the first line */
-               y_offset = GL_LABEL_TEXT_MARGIN +
-                          + gnome_font_get_descender (font)
-                          + (i + 1) * font_size * text_line_spacing
-                           + shadow_y;
-
-               /* Remove any text line spacing from the first row. */
-               y_offset -= font_size * (text_line_spacing - 1);
-
-
-               gnome_print_moveto (pi->pc, x_offset, y_offset);
-
-               gnome_print_gsave (pi->pc);
-               gnome_print_scale (pi->pc, 1.0, -1.0);
-               gnome_print_show (pi->pc, (guchar *)line[i]);
-               gnome_print_grestore (pi->pc);
-       }
+        if (shadow_state)
+        {
+                gnome_print_setrgbcolor (pi->pc,
+                                         GL_COLOR_F_RED (shadow_color),
+                                         GL_COLOR_F_GREEN (shadow_color),
+                                         GL_COLOR_F_BLUE (shadow_color));
+                gnome_print_setopacity (pi->pc, GL_COLOR_F_ALPHA (shadow_color));
+
+                for (i = 0; line[i] != NULL; i++) {
+
+                        glyphlist = gnome_glyphlist_from_text_dumb (font, color,
+                                                                    0.0, 0.0,
+                                                                    (guchar *)line[i]);
+
+                        gnome_glyphlist_bbox (glyphlist, affine, 0, &bbox);
+                        w = bbox.x1;
+                        gnome_glyphlist_unref (glyphlist);
+
+                        switch (just) {
+                        case GTK_JUSTIFY_LEFT:
+                                x_offset = GL_LABEL_TEXT_MARGIN;
+                                break;
+                        case GTK_JUSTIFY_CENTER:
+                                x_offset = (object_w - GL_LABEL_TEXT_MARGIN - w) / 2.0;
+                                break;
+                        case GTK_JUSTIFY_RIGHT:
+                                x_offset = object_w - GL_LABEL_TEXT_MARGIN - w;
+                                break;
+                        default:
+                                x_offset = 0.0;
+                                break; /* shouldn't happen */
+                        }
+                        x_offset += shadow_x;
+
+                        /* Work out the y position to the BOTTOM of the first line */
+                        y_offset = GL_LABEL_TEXT_MARGIN +
+                                + gnome_font_get_descender (font)
+                                + (i + 1) * font_size * text_line_spacing
+                                + shadow_y;
+
+                        /* Remove any text line spacing from the first row. */
+                        y_offset -= font_size * (text_line_spacing - 1);
+
+
+                        gnome_print_moveto (pi->pc, x_offset, y_offset);
+
+                        gnome_print_gsave (pi->pc);
+                        gnome_print_scale (pi->pc, 1.0, -1.0);
+                        gnome_print_show (pi->pc, (guchar *)line[i]);
+                        gnome_print_grestore (pi->pc);
+                }
+        }
 
        gnome_print_setrgbcolor (pi->pc,
                                 GL_COLOR_F_RED (color),