#86 Style property "currentColor" not used properly.

Ethan Merritt

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

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
> 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 '/>

Sodipodi seems to want instead something like:
<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" />


  • Ethan Merritt
    Ethan Merritt

    SVG output from gnuplot's 'test' command

  • Pat Suwalski
    Pat Suwalski

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

    Logged In: YES

    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

    Logged In: YES

    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

    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

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

  • Pat Suwalski
    Pat Suwalski

    Logged In: YES

    Turns out that the SVG has a 'gray area' tag called
    It's very badly explained in the spec at:

    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

    • 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

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

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