#86 Style property "currentColor" not used properly.

closed-fixed
None
9
2003-12-14
2003-06-10
Ethan Merritt
No

This is a copy of a message to the gnuplot development
list, summarizing why sodipodi fails to handle SVG
files output by gnuplot. It is based on a quick
analysis by someone (me :-) totally unfamiliar with
sodipodi.

I also attach the output of gnuplot's 'test' command
with the terminal type set to svg.

On Tuesday 10 June 2003 06:12, Novak Levente wrote:
> I am a total beginner in the field of SVG specs, but
I was
> wondering why gnuplot's SVG terimal produces output
which is
> very badly handled by either Sodipodi (a SVG drawing
tool!)
> and Sketch 0.6.15 (and also earlier revisions). It is
surely not
> because these applications cannot handle SVG

On Tuesday 10 June 2003 09:53, Ethan Merritt wrote:
> sodipodi-0.30.1-2mdk.i586.rpm under Mandrake 9.0 seems to
> work, although imperfectly.

The sodipodi errors fall into 2 classes:

** (sodipodi:13117): WARNING **: No end marker at ...

These are harmless. It is triggered by failing to
terminate a single
style element with a semi-colon

** (sodipodi:13117): WARNING **: Unimplemented style
property id: ...

These ones are the problem. The issue seems to be
that sodipodi does not propagate style elements defined
at a higher level down to individual drawing elements
like vector paths and polygons. This is clearly an
error, and should probably be reported back to the
developers. For whatever reason, it does propagate
text properties, including color, down to individual
text elements. So output of colored text from gnuplot
works fine, but output of colored lines and filled
polygons does not.

Here's an example. Gnuplot writes:
<g style="fill:none; color:blue;
stroke:currentColor; stroke-width:1.00">
<path d='M551,90 L575,90 '></path>
<path d='M551,108 L575,108 '></path>
<polygon fill = 'currentColor' points = '522,82 486,20
414,20 378,82 413,145 486,145 522,82 '/>
....
</g>

Sodipodi seems to want instead something like:
<g>
<path d='M551,90 L575,90' style="fill:none;
color:blue; stroke:currentColor; stroke-width:1.00"></path>
<path d='M551,108 L575,108 ' style="fill:none;
color:blue; stroke:currentColor; stroke-width:1.00"></path>
<polygon points = '522,82 486,20 414,20 378,82 413,145
486,145 522,82 '
style="fill:blue; stroke:currentColor;
stroke-width:1.00" />
...
<g>

Discussion

  • Ethan Merritt
    Ethan Merritt
    2003-06-10

    SVG output from gnuplot's 'test' command

     
    Attachments
  • Pat Suwalski
    Pat Suwalski
    2003-06-16

    • priority: 5 --> 8
    • assigned_to: nobody --> lauris
     
  • Pat Suwalski
    Pat Suwalski
    2003-06-16

    Logged In: YES
    user_id=645772

    I just tried it with sodipodi CVS and your example. Could
    you please verify that the CVS version works properly?

    The only thing I had to change in your example was the
    "currentColor" since you did not provide a definition. I
    replaced it with "#ff00ff" to produce good results. The
    circle had a magenta outline.

     
  • Ethan Merritt
    Ethan Merritt
    2003-06-17

    Logged In: YES
    user_id=235620

    When I build from source sodipodi-0.31.1.tar.gz the
    executable segfaults immediately upon invocation. So the
    most recent runnable version I have is
    sodipodi-0.30.1-2mdk.i586.rpm

    I attach a tarball containing the result of reading
    gnuplot's test.svg into this version of sodipodi, and also
    into the Adobe svg viewer. The adobe viewer handles this
    file correctly. Note that sodipodi has several problems:
    - none of the lines are colored
    - the filled polygon is not colored
    - the point markers at the far right are missing

    I don't know why the point markers are missing, but the
    uncolored lines and polygons are due to a failure to inherit
    style properties from nested scopes.

    If you would like further information or examples, I would
    be happy to provide them. If the current CVS version works
    properly, that's great (and I only wish it would produce a
    runnable executable on my machine).

     
  • Ethan Merritt
    Ethan Merritt
    2003-06-17

    test.svg PNG output - correct (Adobe) and buggy (sodipodi)

     
    Attachments
  • Pat Suwalski
    Pat Suwalski
    2003-06-17

    Logged In: YES
    user_id=645772

    Turns out that the SVG has a 'gray area' tag called
    'currentColor'.
    It's very badly explained in the spec at:
    http://www.w3.org/TR/SVG/color.html#ColorProperty

    Basically, 'currentColor' is supposed to be an alias for the
    'color:' tag. So if you have an item that has 'color:red;
    stroke:currentColor', the stroke should be red.

    I am renaming the bug. The nesting propagation works just
    fine. Try changing all instances of "currentColor" in the
    example to "#ff0000". You'll find it works.

     
  • Pat Suwalski
    Pat Suwalski
    2003-06-17

    • summary: Style properties are not propagated to nested elements --> Style property "currentColor" not used properly.
    • priority: 8 --> 9
    • status: open --> open-accepted
     
  • Logged In: YES
    user_id=19294

    Got color and currentColor working in sodipodi CVS
    version, so they will be out at 0.34

     
    • status: open-accepted --> closed-fixed