GNOME Bugzilla – Bug 767970
PNG generation of SVG misses label texts
Last modified: 2017-12-13 18:21:51 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.
if someone understand what has of bad the un-rendered text, a workaround are welcome
(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.
SVG spec clearly say x attribute is a list of values: https://www.w3.org/TR/SVG/text.html#TSpanElementXAttribute
link to source file: https://upload.wikimedia.org/wikipedia/commons/1/1d/Location_of_connectors_and_ICs_on_Raspberry_Pi_Zero.svg link to misrendered image: https://upload.wikimedia.org/wikipedia/commons/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
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
Created attachment 349342 [details] rendered PNG by Wikipedia
Note: SVG file was saved with Inkscape 0.91
-- 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.