rsvg-view can't display SVG files created by lilypond

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

rsvg-view can't display SVG files created by lilypond

Werner LEMBERG

[lilypond 2.19.43]

I'm running rsvg-view version 2.40.15, and it can't display any SVG
file created by lilypond.  Is this a known issue?

In particular, I can't successfully upload lilypond output to
Wikipedia, which uses the rsvg library...

On the other hand, Firefox and inkview work just fine...


    Werner

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Federico Bruni-2
Il giorno mer 8 giu 2016 alle 14:55, Werner LEMBERG <[hidden email]> ha
scritto:
> [lilypond 2.19.43]
>
> I'm running rsvg-view version 2.40.15, and it can't display any SVG
> file created by lilypond.  Is this a known issue?
>
> In particular, I can't successfully upload lilypond output to
> Wikipedia, which uses the rsvg library...
>
> On the other hand, Firefox and inkview work just fine...

Yes, I confirm it. (did you mean Inkscape?)

I guess that it's some bug of librsvg?

I tried the easiest example:

\version "2.19.42"
\paper {
  tagline = ##f
}
\markup "Hello World"


which produces:


<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2"
width="210.00mm" height="297.00mm" viewBox="0 0 119.5016 169.0094">
<!-- Page: 1/1 -->
<text transform="translate(5.6906, 2.8453)" font-family="serif"
font-size="2.2001" text-anchor="start" fill="currentColor">
<tspan/>
</text>
<text transform="translate(5.6906, 5.5183)" font-family="serif"
font-size="2.2001" text-anchor="start" fill="currentColor">
<tspan>
Hello World</tspan>
</text>
</svg>

EyeOfGnome and Gimp - which use librsvg just like rsvg-view - do not
display anything.

The problem is:

fill="currentColor"




_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Federico Bruni-2
Il giorno mer 8 giu 2016 alle 18:08, Federico Bruni
<[hidden email]> ha scritto:

> I guess that it's some bug of librsvg?
>
> I tried the easiest example:
>
> \version "2.19.42"
> \paper {
>  tagline = ##f
> }
> \markup "Hello World"
>
>
> which produces:
>
>
> <svg xmlns="http://www.w3.org/2000/svg"
> xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2"
> width="210.00mm" height="297.00mm" viewBox="0 0 119.5016 169.0094">
> <!-- Page: 1/1 -->
> <text transform="translate(5.6906, 2.8453)" font-family="serif"
> font-size="2.2001" text-anchor="start" fill="currentColor">
> <tspan/>
> </text>
> <text transform="translate(5.6906, 5.5183)" font-family="serif"
> font-size="2.2001" text-anchor="start" fill="currentColor">
> <tspan>
> Hello World</tspan>
> </text>
> </svg>
>
> EyeOfGnome and Gimp - which use librsvg just like rsvg-view - do not
> display anything.
>
> The problem is:
>
> fill="currentColor"

Fixed in version 2.40.16:
https://bugzilla.gnome.org/show_bug.cgi?id=764808




_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Richard Shann-2
In reply to this post by Federico Bruni-2
On Wed, 2016-06-08 at 18:08 +0200, Federico Bruni wrote:
> EyeOfGnome and Gimp - which use librsvg just like rsvg-view - do not
> display anything.
>
> The problem is:
>
> fill="currentColor"


This use by LilyPond's SVG output of "currentColor" is something I ran
up against when rendering LilyPond's SVG from Denemo. I could not find
any way of making sure that currentColor didn't come out the same as the
background color, so that nothing was seen. I resorted to the LilyPond
code that specifies that the color of all grobs is "black" and then all
was well.
A quick glance at my code suggests that

\applyContext #(override-color-for-all-grobs (x11-color 'black)

will work as a workaround if uploading to Wikipedia.

Would it be a good idea simply to change LilyPond's output, since
"currentColor" seems problematic - LilyPond could use "black" unless it
got overridden by the LilyPond user.

Richard



_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Werner LEMBERG

> A quick glance at my code suggests that
>
> \applyContext #(override-color-for-all-grobs (x11-color 'black)
>
> will work as a workaround if uploading to Wikipedia.

Indeed, that works, thanks!

However, there's still a nasty scaling bug that completely ruins text
positioning at larger magnification values.  Sigh.

Why on earth has Wikipedia selected this buggy rsvg library?


    Werner

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Richard Shann-2
On Wed, 2016-06-08 at 23:44 +0200, Werner LEMBERG wrote:

> > A quick glance at my code suggests that
> >
> > \applyContext #(override-color-for-all-grobs (x11-color 'black)
> >
> > will work as a workaround if uploading to Wikipedia.
>
> Indeed, that works, thanks!
>
> However, there's still a nasty scaling bug that completely ruins text
> positioning at larger magnification values.  Sigh.

Is *this* a bug in librsvg, or another LilyPond output problem?

I didn't look deeply into that - I think I asked here, but I don't
recall getting a clear response...

Richard




_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Werner LEMBERG

>> However, there's still a nasty scaling bug that completely ruins
>> text positioning at larger magnification values.  Sigh.
>
> Is *this* a bug in librsvg, or another LilyPond output problem?

It's definitely a bug in librsvg AFAICS, cf.

  https://phabricator.wikimedia.org/T65703

Have a look at the mentioned file:

  https://upload.wikimedia.org/wikipedia/commons/9/96/Ikaros_solar_sail_key.svg

Then simply magnify it with rsvg-view and look what happens with the
word `Tethers'.  I consider this a very fundamental bug.


   Werner

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Ikaros_solar_sail_key.png (47K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Richard Shann-2
On Thu, 2016-06-09 at 10:15 +0200, Werner LEMBERG wrote:
> >> However, there's still a nasty scaling bug that completely ruins
> >> text positioning at larger magnification values.  Sigh.
> >
> > Is *this* a bug in librsvg, or another LilyPond output problem?
>
> It's definitely a bug in librsvg AFAICS, cf.
>
>   https://phabricator.wikimedia.org/T65703

I see on this page that there is a mention of "Fixed in 2.40.13" however
this page

https://www.mirrorservice.org/sites/ftp.gnome.org/pub/GNOME/sources/librsvg/2.40/librsvg-2.40.13.changes

makes no mention of it. Do you happen to know if we could usefully
upgrade Denemo to use librsvg 2.40.13 (it always involves quite a bit of
work upgrading versions so I thought I'd ask first)

Richard




_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Werner LEMBERG

>> >> However, there's still a nasty scaling bug that completely ruins
>> >> text positioning at larger magnification values.  Sigh.
>> >
>> > Is *this* a bug in librsvg, or another LilyPond output problem?
>>
>> It's definitely a bug in librsvg AFAICS, cf.
>>
>>   https://phabricator.wikimedia.org/T65703
>
> I see on this page that there is a mention of "Fixed in 2.40.13"

I think this is only partially correct, cf.

  https://phabricator.wikimedia.org/T65703#1981688

> Do you happen to know if we could usefully upgrade Denemo to use
> librsvg 2.40.13 (it always involves quite a bit of work upgrading
> versions so I thought I'd ask first)

Sorry, I can't help here.  Regarding librsvg, I'm an ordinary user,
not acquainted with SVG at all.


    Werner

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

David Kastrup
Werner LEMBERG <[hidden email]> writes:

>>> >> However, there's still a nasty scaling bug that completely ruins
>>> >> text positioning at larger magnification values.  Sigh.
>>> >
>>> > Is *this* a bug in librsvg, or another LilyPond output problem?
>>>
>>> It's definitely a bug in librsvg AFAICS, cf.
>>>
>>>   https://phabricator.wikimedia.org/T65703
>>
>> I see on this page that there is a mention of "Fixed in 2.40.13"
>
> I think this is only partially correct, cf.
>
>   https://phabricator.wikimedia.org/T65703#1981688
>
>> Do you happen to know if we could usefully upgrade Denemo to use
>> librsvg 2.40.13 (it always involves quite a bit of work upgrading
>> versions so I thought I'd ask first)
>
> Sorry, I can't help here.  Regarding librsvg, I'm an ordinary user,
> not acquainted with SVG at all.

Well, we are not in the market for SVG compliance testing.  If there are
reasonably simple changes we can make to LilyPond in order to
avoid/sidestep triggering this librsvg bug, then we'll save ourselves a
lot of trouble by just doing some change on our side.  Blame-shifting
tends up to be a lot of work and hassle with _our_ users, never mind
that technically we are not at fault at all.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Richard Shann-2
On Thu, 2016-06-09 at 12:57 +0200, David Kastrup wrote:

> Werner LEMBERG <[hidden email]> writes:
>
> >>> >> However, there's still a nasty scaling bug that completely ruins
> >>> >> text positioning at larger magnification values.  Sigh.
> >>> >
> >>> > Is *this* a bug in librsvg, or another LilyPond output problem?
> >>>
> >>> It's definitely a bug in librsvg AFAICS, cf.
> >>>
> >>>   https://phabricator.wikimedia.org/T65703
> >>
> >> I see on this page that there is a mention of "Fixed in 2.40.13"
> >
> > I think this is only partially correct, cf.
> >
> >   https://phabricator.wikimedia.org/T65703#1981688
> >
> >> Do you happen to know if we could usefully upgrade Denemo to use
> >> librsvg 2.40.13 (it always involves quite a bit of work upgrading
> >> versions so I thought I'd ask first)
> >
> > Sorry, I can't help here.  Regarding librsvg, I'm an ordinary user,
> > not acquainted with SVG at all.
>
> Well, we are not in the market for SVG compliance testing.  If there are
> reasonably simple changes we can make to LilyPond in order to
> avoid/sidestep triggering this librsvg bug,

I don't know about *this* bug, but I did test out replacing currentColor
with "black" (in quotes) in the LilyPond source code and it worked fine;
that seems to me not only a simple but also a fairly sensible change.

Richard



_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

David Kastrup
Richard Shann <[hidden email]> writes:

> On Thu, 2016-06-09 at 12:57 +0200, David Kastrup wrote:
>> Werner LEMBERG <[hidden email]> writes:
>>
>> >>> >> However, there's still a nasty scaling bug that completely ruins
>> >>> >> text positioning at larger magnification values.  Sigh.
>> >>> >
>> >>> > Is *this* a bug in librsvg, or another LilyPond output problem?
>> >>>
>> >>> It's definitely a bug in librsvg AFAICS, cf.
>> >>>
>> >>>   https://phabricator.wikimedia.org/T65703
>> >>
>> >> I see on this page that there is a mention of "Fixed in 2.40.13"
>> >
>> > I think this is only partially correct, cf.
>> >
>> >   https://phabricator.wikimedia.org/T65703#1981688
>> >
>> >> Do you happen to know if we could usefully upgrade Denemo to use
>> >> librsvg 2.40.13 (it always involves quite a bit of work upgrading
>> >> versions so I thought I'd ask first)
>> >
>> > Sorry, I can't help here.  Regarding librsvg, I'm an ordinary user,
>> > not acquainted with SVG at all.
>>
>> Well, we are not in the market for SVG compliance testing.  If there are
>> reasonably simple changes we can make to LilyPond in order to
>> avoid/sidestep triggering this librsvg bug,
>
> I don't know about *this* bug, but I did test out replacing currentColor
> with "black" (in quotes) in the LilyPond source code and it worked fine;
> that seems to me not only a simple but also a fairly sensible change.

Except that it would make it impossible to draw in colors other than
black.  That was the rationale for using currentColor in the first
place.

It would seem like a better idea to explicitly establish a documentwide
default of currentColor to black explicitly somewhere.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Richard Shann-2
On Thu, 2016-06-09 at 13:23 +0200, David Kastrup wrote:

> Richard Shann <[hidden email]> writes:
>
> > On Thu, 2016-06-09 at 12:57 +0200, David Kastrup wrote:
> >> Werner LEMBERG <[hidden email]> writes:
> >>
> >> >>> >> However, there's still a nasty scaling bug that completely ruins
> >> >>> >> text positioning at larger magnification values.  Sigh.
> >> >>> >
> >> >>> > Is *this* a bug in librsvg, or another LilyPond output problem?
> >> >>>
> >> >>> It's definitely a bug in librsvg AFAICS, cf.
> >> >>>
> >> >>>   https://phabricator.wikimedia.org/T65703
> >> >>
> >> >> I see on this page that there is a mention of "Fixed in 2.40.13"
> >> >
> >> > I think this is only partially correct, cf.
> >> >
> >> >   https://phabricator.wikimedia.org/T65703#1981688
> >> >
> >> >> Do you happen to know if we could usefully upgrade Denemo to use
> >> >> librsvg 2.40.13 (it always involves quite a bit of work upgrading
> >> >> versions so I thought I'd ask first)
> >> >
> >> > Sorry, I can't help here.  Regarding librsvg, I'm an ordinary user,
> >> > not acquainted with SVG at all.
> >>
> >> Well, we are not in the market for SVG compliance testing.  If there are
> >> reasonably simple changes we can make to LilyPond in order to
> >> avoid/sidestep triggering this librsvg bug,
> >
> > I don't know about *this* bug, but I did test out replacing currentColor
> > with "black" (in quotes) in the LilyPond source code and it worked fine;
> > that seems to me not only a simple but also a fairly sensible change.
>
> Except that it would make it impossible to draw in colors other than
> black.  That was the rationale for using currentColor in the first
> place.

Oh, if that is the case then I'm misremembering - I thought I found that
explicitly set colors over-rode the value currentColor (or "black" or
whatever you put at that place in the code).

Richard




_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Werner LEMBERG
In reply to this post by Richard Shann-2
>> Well, we are not in the market for SVG compliance testing.  If
>> there are reasonably simple changes we can make to LilyPond in
>> order to avoid/sidestep triggering this librsvg bug,
>
> I don't know about *this* bug,

BTW, can you reproduce the problem that I've shown in my previous
e-mail?


    Werner

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Werner LEMBERG
In reply to this post by David Kastrup

> It would seem like a better idea to explicitly establish a
> documentwide default of currentColor to black explicitly somewhere.

Perhaps a `-dxxx' command-line option?


    Werner

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

David Kastrup
In reply to this post by Richard Shann-2
Richard Shann <[hidden email]> writes:

> On Thu, 2016-06-09 at 13:23 +0200, David Kastrup wrote:
>> Richard Shann <[hidden email]> writes:
>>
>> > I don't know about *this* bug, but I did test out replacing
>> > currentColor with "black" (in quotes) in the LilyPond source code
>> > and it worked fine; that seems to me not only a simple but also a
>> > fairly sensible change.
>>
>> Except that it would make it impossible to draw in colors other than
>> black.  That was the rationale for using currentColor in the first
>> place.
>
> Oh, if that is the case then I'm misremembering - I thought I found
> that explicitly set colors over-rode the value currentColor (or
> "black" or whatever you put at that place in the code).

What is "that place"?

dak@lola:/usr/local/tmp/lilypond$ git grep currentColor
Documentation/misc/ChangeLog-2.10:      change black to currentColor everywhere. This fixes color support
scm/output-svg.scm:          (set-attribute 'fill "currentColor"))
scm/output-svg.scm:  (set-attribute 'fill "currentColor")
scm/output-svg.scm:   `(fill . ,(if is-filled "currentColor" "none"))
scm/output-svg.scm:   `(stroke . "currentColor")
scm/output-svg.scm:            (stroke . "currentColor")
scm/output-svg.scm:   `(fill . ,(if is-filled "currentColor" "none"))
scm/output-svg.scm:   `(stroke . "currentColor")
scm/output-svg.scm:         `(fill . ,(if fill "currentColor" "none"))
scm/output-svg.scm:         `(stroke . "currentColor")
scm/output-svg.scm:         `(fill . ,(if fill "currentColor" "none"))
scm/output-svg.scm:         `(stroke . "currentColor")
scm/output-svg.scm:            '(stroke . "currentColor")
scm/output-svg.scm:            `(fill . ,(if fill? "currentColor" "none"))
scm/output-svg.scm:   `(fill . ,(if is-filled "currentColor" "none"))
scm/output-svg.scm:   '(stroke . "currentColor")
scm/output-svg.scm:   '(fill . "currentColor")))


--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

David Kastrup
In reply to this post by Werner LEMBERG
Werner LEMBERG <[hidden email]> writes:

>> It would seem like a better idea to explicitly establish a
>> documentwide default of currentColor to black explicitly somewhere.
>
> Perhaps a `-dxxx' command-line option?

Anything requiring explicit user effort in order to produce expected
results is not going to mitigate the damage.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Werner LEMBERG
>>> It would seem like a better idea to explicitly establish a
>>> documentwide default of currentColor to black explicitly
>>> somewhere.
>>
>> Perhaps a `-dxxx' command-line option?
>
> Anything requiring explicit user effort in order to produce expected
> results is not going to mitigate the damage.

Mhmm, `damage' is too big a word IMHO.  This problem is already fixed
in the latest release of librsvg (and it wasn't present in some
earlier versions about a year ago; at least I was able to submit an
SVG to Wikipedia without any problems), and I believe that at least
Wikipedia will update within the next few months.

The current default of Lilypond is not wrong, as far as I can see.


    Werner

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

David Kastrup
Werner LEMBERG <[hidden email]> writes:

>>>> It would seem like a better idea to explicitly establish a
>>>> documentwide default of currentColor to black explicitly
>>>> somewhere.
>>>
>>> Perhaps a `-dxxx' command-line option?
>>
>> Anything requiring explicit user effort in order to produce expected
>> results is not going to mitigate the damage.
>
> Mhmm, `damage' is too big a word IMHO.  This problem is already fixed
> in the latest release of librsvg (and it wasn't present in some
> earlier versions about a year ago; at least I was able to submit an
> SVG to Wikipedia without any problems), and I believe that at least
> Wikipedia will update within the next few months.

So a half-year outage of LilyPond on Wikipedia and a messup of Denemo
and a number of other applications is not "damage".

> The current default of Lilypond is not wrong, as far as I can see.

Shrug.  It doesn't matter whether we can nominally justify calling this
"somebody else's problem".  The fallout still piles up in our backyard.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: rsvg-view can't display SVG files created by lilypond

Werner LEMBERG

>> Mhmm, `damage' is too big a word IMHO.  This problem is already
>> fixed in the latest release of librsvg (and it wasn't present in
>> some earlier versions about a year ago; at least I was able to
>> submit an SVG to Wikipedia without any problems), and I believe
>> that at least Wikipedia will update within the next few months.
>
> So a half-year outage of LilyPond on Wikipedia and a messup of
> Denemo and a number of other applications is not "damage".

I guess that with a new non-developer lilypond release the problems
with Wikipedia are already solved.  Up to now it seems that noone has
noticed the problem with lilypond at all – I was the first who has
reported this here, it seems...

BTW, already uploaded files to Wikipedia are usually not an issue,
since (a) the browsers that display SVGs directly are not affected,
and (b) the SVGtoPNG conversion on Wikipedia worked fine also until a
librsvg update broke this a few months ago.

Of course I don't object to a sensible solution, if you have one.


    Werner
_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
12