After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767970 - PNG generation of SVG misses label texts
PNG generation of SVG misses label texts
Status: RESOLVED OBSOLETE
Product: librsvg
Classification: Core
Component: general
2.40.x
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-23 09:15 UTC by Moritz Mühlenhoff
Modified: 2017-12-13 18:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
original file with tspan x attribute that includes more values (248.80 KB, image/svg+xml)
2017-04-06 07:56 UTC, Valerio Messina
Details
rendered PNG by Wikipedia (43.08 KB, image/png)
2017-04-06 08:02 UTC, Valerio Messina
Details

Description Moritz Mühlenhoff 2016-06-23 09:15:38 UTC
Wikimedia Commons uses rsvg-convert to create PNG versions of SVG files uploaded to Wikimedia Commons. A user reported a file which misses various text labels in the PNG version (original report at https://phabricator.wikimedia.org/T123106):

For the following SVG file:

https://upload.wikimedia.org/wikipedia/en/1/1d/Location_of_connectors_and_ICs_on_Raspberry_Pi_Zero.svg

rsvg-convert generates PNG versions which miss the following text labels:

- white "GPIO" in the rectangle
- white "MICRO\nSD CARD" near left SD slot
- white "USB" near right-bottom USB port
- white "POWER IN" near left-bottom USB port
- white "ACT" near right led
- white "TV" and "RUN" near right-top jumper
- black "512" inside the Broadcom BCM2835 chip

Here's an example of such a misrendered file: 
https://upload.wikimedia.org/wikipedia/en/thumb/1/1d/Location_of_connectors_and_ICs_on_Raspberry_Pi_Zero.svg/1024px-Location_of_connectors_and_ICs_on_Raspberry_Pi_Zero.svg.png

This was reproduced with 2.40.16. Please let me know if you need additional information.
Comment 1 Valerio Messina 2016-06-23 11:44:48 UTC
if someone understand what has of bad the un-rendered text, a workaround are welcome
Comment 2 Massimo 2016-06-23 13:27:52 UTC
(In reply to Valerio Messina from comment #1)
> if someone understand what has of bad the un-rendered text, a workaround are
> welcome


for a librsvg workaround you can replace the 

return 0.0; 

here:

https://git.gnome.org/browse/librsvg/tree/rsvg-css.c#n170

with a 

return length;

the white GPIO in the rectangle is visible, the letters following
the 'G' are probably not where the svg author intends but they
are near.

It's not a fix. 

librsvg does not honor the tspan x attribute when it includes more
values, so the other workaround is not to use them in your svgs.
Comment 3 Valerio Messina 2016-06-23 22:45:13 UTC
SVG spec clearly say x attribute is a list of values:
https://www.w3.org/TR/SVG/text.html#TSpanElementXAttribute
Comment 5 Valerio Messina 2017-04-06 07:56:50 UTC
Created attachment 349341 [details]
original file with tspan x attribute that includes more values

I had to update the file on Wikipedia, so links will point to files with work around. Attached the SVG file with tspan x attribute that includes more values
Comment 6 Valerio Messina 2017-04-06 08:02:08 UTC
Created attachment 349342 [details]
rendered PNG by Wikipedia
Comment 7 Valerio Messina 2017-04-06 09:46:47 UTC
Note: SVG file was saved with Inkscape 0.91
Comment 8 GNOME Infrastructure Team 2017-12-13 18:21:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/librsvg/issues/146.