Subject: Problem with user-created shapes with <svg:text>
Date: Sun, 22 Sep 2002 12:52:29 -0400
I'm trying to create some shapes with <svg:text> elements and I'm having some
trouble.
I wrote a Perl script to scan through Verilog files and create Dia shapes from
the module definitions. Essentially they are boxes with the input/output port
names inside and a connection point next to each port, plus a text box on top
for the instance name. Then you just drop them on a diagram, "wire" them up,
and get a nice neat drawing of your design with little manual effort.
So the script writes out the shape files and a sheet file, I move them over to
my ~/.dia directories, start up Dia and there they are. I drop them onto a
new diagram, resize/wire them up and save the file. No problem so far.
However, when I try to open the file Dia throws a segmentation fault. After a
little bit of poking around, I found that Dia didn't like the <svg:text>
elements I had in the shape files. That is, if I got rid of all them, the
diagram would open up just fine. Of course it's a basically worthless diagram
now! By accident I discovered that if I open a new diagram, put one of each
shape on it, THEN open the saved file it's OK, text and all.
Here's an example of how a shape file looks:
<?xml version="1.0"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns"
xmlns:svg="http://www.w3.org/2000/svg">
<name>cpu80x1 - cpu80x1_reg</name>
<textbox x1="0" y1="-11.25" x2="40" y2="-1.25" />
<connections>
<point x="0" y="2.5"/>
<point x="0" y="5"/>
<point x="0" y="7.5"/>
<point x="0" y="10"/>
<point x="0" y="12.5"/>
<point x="0" y="15"/>
<point x="40" y="2.5"/>
</connections>
<svg:svg>
<svg:rect style="stroke-width: 0.5"
x="0" y="0" width="40" height="17.5" />
<svg:text style="fill: #000000; text-anchor:start; font-size: 0.5"
x="1.25" y="2.75">I_clk</svg:text>
<svg:text style="fill: #000000; text-anchor:start; font-size: 0.5"
x="1.25" y="5.25">I_rst</svg:text>
<svg:text style="fill: #000000; text-anchor:start; font-size: 0.5"
x="1.25" y="7.75">I_data</svg:text>
<svg:text style="fill: #000000; text-anchor:start; font-size: 0.5"
x="1.25" y="10.25">I_ld</svg:text>
<svg:text style="fill: #000000; text-anchor:start; font-size: 0.5"
x="1.25" y="12.75">I_addend</svg:text>
<svg:text style="fill: #000000; text-anchor:start; font-size: 0.5"
x="1.25" y="15.25">I_add</svg:text>
<svg:text style="fill: #000000; text-anchor:end; font-size: 0.5"
x="38.75" y="2.75">O_data</svg:text>
</svg:svg>
</shape>
I am running Mandrake 8.2, with Dia 0.90 compiled from the latest sources from
ftp.gnome.org. I poked around in the source code a bit to try to figure out
what the problem was myself, but didn't have much luck isolating it by
sprinkling "printf"s in strategic locations. Has anyone seen this kind of
behavior before, or can someone point me at the right files to look at?
Help!
Scott