Hi

Here is the longer patch, in dpatch format attached.
 -> 05_fix_latex_patch.dpatch

As written only applying the first part, will add a the LaTeX formula
rendering capability again, but the seconds blends out e.g. the
version string dialog box get from pstoedit (but implemented another
way without the -quit switch, which is not in our pstoedit version,
only by a patch in fedora 9).

The patch is taken from launchpad:
https://bugs.launchpad.net/inkscape/+bug/55273

The source package files can be found here:
 - http://arda.homelinux.org/debian/pool-sid-i386/inkscape_0.46-3.1.dsc
 - http://arda.homelinux.org/debian/pool-sid-i386/inkscape_0.46-3.1.diff.gz
 - http://arda.homelinux.org/debian/pool-sid-i386/inkscape_0.46.orig.tar.gz

In addition to the patch I moved only python-lxml to Recommends.

Thanks in advance!
Kind regards
Salvatore
#! /bin/sh /usr/share/dpatch/dpatch-run
## 05_fix_latex_patch.dpatch by Salvatore Bonaccorso <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix LaTeX formula rendering
## DP: Patch is taken from: https://bugs.launchpad.net/inkscape/+bug/55273

@DPATCH@

--- inkscape-0.46.orig/share/extensions/eqtexsvg.py     2008-11-20 
21:45:36.339896646 +0100
+++ inkscape-0.46/share/extensions/eqtexsvg.py  2008-11-20 21:46:11.067896917 
+0100
@@ -49,16 +49,18 @@
     doc_sizeW = max(doc_width,doc_height)
 
     def clone_and_rewrite(self, node_in):
-        if node_in.tag != 'svg':
-            node_out = inkex.etree.Element(inkex.addNS(node_in.tag,'svg'))
+        in_tag = node_in.tag.rsplit('}',1)[-1]
+        if in_tag != 'svg':
+            node_out = inkex.etree.Element(inkex.addNS(in_tag,'svg'))
             for name in node_in.attrib:
                 node_out.set(name, node_in.attrib[name])
         else:
             node_out = inkex.etree.Element(inkex.addNS('g','svg'))
         for c in node_in.iterchildren():
-            if c.tag in ('g', 'path', 'polyline', 'polygon'):
+            c_tag = c.tag.rsplit('}',1)[-1]
+            if c_tag in ('g', 'path', 'polyline', 'polygon'):
                 child = clone_and_rewrite(self, c)
-                if c.tag == 'g':
+                if c_tag == 'g':
                     
child.set('transform','matrix('+str(doc_sizeH/700.)+',0,0,'+str(-doc_sizeH/700.)+','+str(-doc_sizeH*0.25)+','+str(doc_sizeW*0.75)+')')
                 node_out.append(child)
 
@@ -86,6 +88,7 @@
         dvi_file = os.path.join(base_dir, "eq.dvi")
         svg_file = os.path.join(base_dir, "eq.svg")
         out_file = os.path.join(base_dir, "eq.out")
+        err_file = os.path.join(base_dir, "eq.err")
 
         def clean():
             os.remove(latex_file)
@@ -95,6 +98,8 @@
             os.remove(dvi_file)
             os.remove(svg_file)
             os.remove(out_file)
+            if os.path.exists(err_file):
+                os.remove(err_file)
             os.rmdir(base_dir)
 
         create_equation_tex(latex_file, self.options.formula)
@@ -109,10 +114,20 @@
             sys.exit(1)
 
         os.system('dvips -q -f -E -D 600 -y 5000 -o ' + ps_file + ' ' + 
dvi_file)
-        #os.system('cd ' + base_dir)
-        os.system('pstoedit -f plot-svg -dt -ssp ' + ps_file + ' ' + svg_file 
+ '> ' + out_file)
-        svg_open(self, svg_file)
+        # cd to base_dir is necessary, because pstoedit
+        # writes temporary files to cwd and needs write
+        # permissions
+        os.system('cd ' + base_dir + ' ; pstoedit -f plot-svg -dt -ssp ' + 
ps_file + ' ' + svg_file + '  > ' + out_file + ' 2> ' + err_file)
+
+        # forward errors to stderr but skip pstoedit header
+        if os.path.exists(err_file):
+            err_stream = open(err_file, 'r')
+            for line in err_stream:
+                if not line.startswith('pstoedit: version'):
+                    sys.stderr.write(line + '\n')
+            err_stream.close()
 
+        svg_open(self, svg_file)
         clean()
 
 e = EQTEXSVG()

Attachment: signature.asc
Description: Digital signature

Reply via email to