Menu

#5429 SVG export - Scribus import of LP generated SVG files gives unexpected results

New
nobody
None
Defect
2018-12-04
2018-10-16
No

Also reported to Scribus - https://bugs.scribus.net/view.php?id=15454

On 11/10/2018 2:56 pm, d_l wrote:
I have joined this list today just for the purpose of facilitating a link
between Scribus and LilyPond forums and posting one PATCH suggestion before
next imminent release of lilypond.

Over at the Scribus forum a small issue prevents svg output from lilypond
commandline being rendered in Scribus the desktop publishing tool. PNG
output works.

The Scribus issue refers to SVG fill attribute "currentColor" being used
instead of "black".

References:
https://bugs.scribus.net/view.php?id=15454

http://lilypond.1069038.n5.nabble.com/rsvg-view-can-t-display-SVG-files-created-by-lilypond-tc191462.html#a191496

Here is a quote from a Scribus forum snr. member:

"the lillypond authors seem to know about the issue but (probably) wrongly
decided to do nothing...

can somebody who uses lillypond try to post a bug report for this issue with
jean's explanation from the bug tracker and telling them that this shortcut
makes hard to import the svg in scribus?
(i mean, they could keep track of the color used and always set it
explicitly, instead of relying on a default value that seems not to be 100%
standardized)."

2 Attachments

Discussion

  • Carl Sorensen

    Carl Sorensen - 2018-10-16

    I believe that LilyPond's behavior is correct. From the Scribus bug discussion referenced above, Scribus administrator jghali says:
    "However both SVG 1.1 and CSS 2 specs tells us the the default value of 'color' is 'user agent defined', ie implementation defined. So the result of using 'currentColor' before specifying explicitly a value for 'color' will be implementation defined. Given that this svg from lillypond does not specify a 'color' value before using 'currentColor', I have to consider that lillypond is relying on undefined behavior and hence this is up to Lillypond to stop relying on such undefined behavior."

    When Scribus imports an SVG file, Scribus is acting as a user agent. The user agent is the renderer of the image, not the creator of the image. Scribus has modified their default currentColor to black, to match the standard of web browsers. IMO, this is the correct thing to do.

    By using currentColor instead of black, I can easily use CSS to display my LilyPond music output as SVG in any color I wish.

    I don't believe LilyPond's behavior should change.

     
  • Paul Morris

    Paul Morris - 2018-12-03

    currentColor sounds like the right default. It also seems reasonable to allow the user to override that default and set it to black or another color, depending on their use case. Maybe that's already possible? Maybe it's already possible from the command line? I haven't looked closer, but empowering users through such options is one of LilyPond's strengths.

     
    • Carl Sorensen

      Carl Sorensen - 2018-12-04

      It would be relatively straightforward to postprocess the output svg file using sed and change every occurence of currentColor to something else, e.g. black. And that behavior could be set with a command-line setting. Perhaps that is an approach consistent with Paul's suggestion.