yaozhenx / mscgen

Automatically exported from code.google.com/p/mscgen
GNU General Public License v2.0
0 stars 0 forks source link

Loading mscgen .svg file into Dia shows improper formatting & is very messy #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Install latest Dia for Win32 (0.97.2)
Dia is an open source diagrammer project.

2.Generate mscgen diagram with -T svg
3.Load .svg into Dia

What is the expected output? What do you see instead?

mscgen -T png creates correct diagram with this file.
mscgen -T svg creates a seemingly correct svg viewable in Win32 Safari.

Expected to see valid formatting of diagram in svg in Dia.
Instead, Dia shows:

a) Text within the box & rbox seems to have some offset error and overlaps 
other text.  The offset error seems to be constant.

b) Text is overwritten by other objects with fill-color set to white, 
so text is not readable.  Somewhat possible to fix some of this if all objects 
in Dia are selected and "draw background" is set to "No", presumably this means 
make the object transparent.

c) the "--- [label=x]" line is not correct.  In Dia it makes a solid line, not 
a dashed line.

d) the ID text (used on lines and boxes) is not superscript as expected, it's 
normal font.

e) there seem to be extra white lines in Dia.  These correspond to other lines 
in the mscgen diagram.

Probably if the mscgen's output-to-svg put the elements (text, lines, boxes) on 
different layers, this would be less of a problem (I assume svg supports 
layers).

What version of mscgen are you using? On what operating system?

Mscgen version 0.20, Win32 msys

Please provide any additional information below, including sample input
file:

not possible to provide mscgen file, but should be easily reproducable.

Conclusion - Not sure if modification to mscgen would make it's svg output more 
readable in Dia, or if all the above are only bugs in Dia itself.

Original issue reported on code.google.com by jncline@gmail.com on 27 Jan 2012 at 11:12

GoogleCodeExporter commented 9 years ago
Looks like Dia interprets newline characters within SVG text elements.  Thus

<text x=... y=... ...>
hello
</text>

results in a newline ahead of 'hello'.  I think this is a bug in Dia since the 
default XML rendering mode should be to remove newlines:

http://www.w3.org/TR/SVG/text.html#WhiteSpace

None the less, I can remove the newlines from the output to improve this aspect 
of how the SVG appears in Dia.

Please consider raising a bug against Dia.

Original comment by Michael....@gmail.com on 22 Jul 2012 at 10:02

GoogleCodeExporter commented 9 years ago
Remaining issues look to be with Dia.  It looks like it ignores 'stroke-dash' 
and isn't using a font with correct/matching metrics.  Mscgen uses drawing 
order to determine layers as per the SVG standard, so errors in overlapping are 
likely due to Dia not implementing that correctly.

http://www.w3.org/TR/SVG/render.html#PaintersModel

That said, of the samples I checked, Dia now looks okay (give or take overrun 
of long text lines), and is quite a good program.

Please consider producing test cases and reporting to the Dia project.

Original comment by Michael....@gmail.com on 22 Jul 2012 at 10:18