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

Re: Some issues



On Sat, 2003-12-13 at 10:29, Jon A. Solworth wrote:
> On Sat, 2003-12-13 at 09:06, Lars Clausen wrote:
> >
> > As for XFig, if you send me a diagram that is improperly exported, I shall
> > certainly take a look, it's one of my darlings:)
> > 
> 
> Lars,
> 
> Here it is.  If it gets mangled, let me know.
> 
> Jon

I'm working on the color text metapost patch.  

Jon, as far as the text in your messages go, what are your intentions
for strings with underscores and braces?  It seems that there was a
routine to escape these in the pstricks filter, but it has been
disabled.  I agree with the comment there that TeX users will do what
they intend.  So are these to be typeset as math or should they be as \_
and \{ \}?  Unfortunately, it seems that even \{ \} won't do it.  I had
to specifically set these to $\{$ $\}$.

At any rate, here is the patch and two new versions of your dia file I
test it against.




? .tm_project.cache
? dia.prj
? dia.pws
? intltool-modules
? mpost_string_color.patch
? plug-ins/pixbuf/Makefile
? shapes/Cisco/Makefile
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/dia/ChangeLog,v
retrieving revision 1.1421
diff -u -r1.1421 ChangeLog
--- ChangeLog	14 Dec 2003 19:56:20 -0000	1.1421
+++ ChangeLog	17 Dec 2003 07:30:58 -0000
@@ -1,3 +1,7 @@
+2003-12-17  Chris Sperandio <sperandi@eng.usf.edu>
+	* plug-ins/metapost/render_metapost.c: Fixed string colorization.
+	Added checks against color_black.
+
 2003-12-14  Lars Clausen  <lrclause@cs.uiuc.edu>
 
 	* shapes/Circuit/hresistor.shape: Uses new extra attribute thing.
Index: plug-ins/metapost/render_metapost.c
===================================================================
RCS file: /cvs/gnome/dia/plug-ins/metapost/render_metapost.c,v
retrieving revision 1.8
diff -u -r1.8 render_metapost.c
--- plug-ins/metapost/render_metapost.c	11 Jul 2003 15:21:51 -0000	1.8
+++ plug-ins/metapost/render_metapost.c	17 Dec 2003 07:31:01 -0000
@@ -154,7 +154,7 @@
 
 static void
 metapost_renderer_finalize (GObject *object)
-{
+{ 
   MetapostRenderer *metapost_renderer = METAPOST_RENDERER (object);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -210,10 +210,13 @@
 {
     fprintf(renderer->file, "\n    withpen pencircle scaled %5.4fx", 
             (double)renderer->line_width);
-    fprintf(renderer->file, "\n    withcolor (%5.4f, %5.4f, %5.4f)", 
-            (double)renderer->color.red,
-            (double)renderer->color.green,
-            (double)renderer->color.blue);
+    
+    if (!color_equals(&renderer->color, &color_black))
+        fprintf(renderer->file, "\n    withcolor (%5.4f, %5.4f, %5.4f)", 
+                (double)renderer->color.red,
+                (double)renderer->color.green,
+                (double)renderer->color.blue);
+    
     draw_with_linestyle(renderer);
     fprintf(renderer->file, ";\n");
 }
@@ -716,8 +719,15 @@
 	break;
     }
     fprintf(renderer->file,
-	    "(btex %s etex,(%fx,%fy));\n",
+	    "(btex %s etex,(%fx,%fy))",
 	    text, pos->x, pos->y);
+    if (!color_equals(&renderer->color, &color_black))
+        fprintf(renderer->file, "\n    withcolor (%5.4f, %5.4f, %5.4f)", 
+                (double)renderer->color.red, 
+                (double)renderer->color.green,
+                (double)renderer->color.blue);
+
+    fprintf(renderer->file,";\n");
 }
 
 static void
@@ -769,7 +779,6 @@
             fprintf(renderer->file, "\n");
         }
     } else {
-        guint8 *ptr = rgb_data;
         for (y = 0, iy = point->y; y < img_height; y++, iy += ystep) {
             for (x = 0, ix = point->x; x < img_width; x++, ix += xstep) {
                 int i = y*img_rowstride+x*3;
@@ -784,7 +793,7 @@
     }
     
     g_free(mask_data);
-    g_free (rgb_data);
+    g_free(rgb_data);
 }
 
 /* --- export filter interface --- */

needhamSchroeder_math.dia

needhamSchroeder_txt.dia



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK