Hi, we have some icons which are made in inkscape but render differently in RSVG,
Most (all?) of the applications on Linux are using RSVG, so I was wondering if there is a good way to determine if this is some special inkscape feature or a bug/limitation in RSVG.
Comparison:
http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas... http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas...
Note that RSVG seems to fail on groups that have alpha masking.
On Mon, Dec 23, 2013 at 07:34:24AM +1100, Campbell Barton wrote:
Hi, we have some icons which are made in inkscape but render differently in RSVG,
Most (all?) of the applications on Linux are using RSVG, so I was wondering if there is a good way to determine if this is some special inkscape feature or a bug/limitation in RSVG.
Comparison:
http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas... http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas...
Note that RSVG seems to fail on groups that have alpha masking.
Neither Inkscape nor RSVG are 100% perfect implementations of the SVG specification, but they are deficient in different areas, and that usually accounts for deltas in rendering output.
Since the icons were made in inkscape, offhand I'd guess that some Inkscape feature (like alpha masking) was used that RSVG didn't have implemented (or which has some bug.)
Bryce
2013/12/22 Campbell Barton <ideasman42@...400...>:
Hi, we have some icons which are made in inkscape but render differently in RSVG,
Most (all?) of the applications on Linux are using RSVG, so I was wondering if there is a good way to determine if this is some special inkscape feature or a bug/limitation in RSVG.
Comparison:
http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas... http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas...
These files are rather large and at first glance I don't see any differences between the SVG file as rendered by Inkscape and the PNG file. Can you point out which icons render differently?
It would be ideal if you prepared a minimal file that still shows a rendering difference, then it would be far easier to identify the issue.
Regards, Krzysztof
On 2013-12-22 21:34 +0100, Campbell Barton wrote:
Hi, we have some icons which are made in inkscape but render differently in RSVG,
Most (all?) of the applications on Linux are using RSVG, so I was wondering if there is a good way to determine if this is some special inkscape feature or a bug/limitation in RSVG.
Comparison:
http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas... http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas...
Note that RSVG seems to fail on groups that have alpha masking.
It appears that librsvg doesn't handle Inkscape's <mask> notation well: when creating a <mask> element, Inkscape always defines 'maskUnits="userSpaceOnUse"' [1], but not the properties 'x', 'y', 'width', 'height' (for the "largest possible offscreen buffer").
AFAICT the SVG 1.1 spec defines relative fallback values (x, y: -10%, width, height: 120%) if the position and size properties are not defined [2], but it's unclear to me how those relate to maskUnits 'userSpaceOnUse'.
librsvg doesn't appear to use fallback values if maskUnits are 'userSpaceOnUse' (setting them explicitly makes the masked objects reappear). If maskUnits are 'objectBoundingBox', or omitted entirely, librsvg renders the masked objects as expected, whether or not position and size of the offscreen buffer are explicitly defined or not.
Attached: - test1.svg: sample affected icon extracted from blender_icons.svg - test1-no-maskUnits.svg maskUnits property deleted - test1-objectBoundingBox.svg maskUnits set to objectBoundingBox instead of userSpaceOnUse - test1-userSpaceOnUse-explicit-fallback-values.svg maskUnits userSpaceOnUse with explicit relative fallback values - test1-objectBoundingBox-explicit-fallback-values.svg maskUnits objectBoundingBox with explicit relative fallback values
Test files viewed and compared on OS X 10.7.5 with - Inkscape 0.48.4 r10006, 0.48+devel r12854 - rsvg-view-3 from librsvg 2.40.0 - cairo 1.12.16
[1] http://www.w3.org/TR/SVG11/masking.html#MaskElementMaskUnitsAttribute [2] http://www.w3.org/TR/SVG11/masking.html#MaskElementXAttribute
On 2013-12-24 03:35 +0100, su_v wrote:
On 2013-12-22 21:34 +0100, Campbell Barton wrote:
Hi, we have some icons which are made in inkscape but render differently in RSVG,
Most (all?) of the applications on Linux are using RSVG, so I was wondering if there is a good way to determine if this is some special inkscape feature or a bug/limitation in RSVG.
Comparison:
http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas... http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas...
Note that RSVG seems to fail on groups that have alpha masking.
It appears that librsvg doesn't handle Inkscape's <mask> notation well: when creating a <mask> element, Inkscape always defines 'maskUnits="userSpaceOnUse"' [1], but not the properties 'x', 'y', 'width', 'height' (for the "largest possible offscreen buffer").
AFAICT the SVG 1.1 spec defines relative fallback values (x, y: -10%, width, height: 120%) if the position and size properties are not defined [2], but it's unclear to me how those relate to maskUnits 'userSpaceOnUse'.
librsvg doesn't appear to use fallback values if maskUnits are 'userSpaceOnUse' (setting them explicitly makes the masked objects reappear). If maskUnits are 'objectBoundingBox', or omitted entirely, librsvg renders the masked objects as expected, whether or not position and size of the offscreen buffer are explicitly defined or not.
Steps to reproduce: 1) download sample file from w3.org: http://www.w3.org/TR/SVG11/images/masking/mask01.svg 2) open mask01.svg with rsvg-view-3 --> masked blue text is rendered as expected 3) open mask01.svg in Inkscape, release mask on blue text, reapply same mask, save as new file 4) open file from step 3 with rsvg-view-3: --> the masked object (blue text) is missing
AFAICT this occurs independent of viewBox settings or transform attributes (on parent container elements of the masked object(s), on the masked objects, or on objects in the definition of the mask element). It also does not depend on the usage of gradients in masks (the same affect can be reproduced with masks which use a solid fill color).
On 2013-12-24 03:35 +0100, su_v wrote:
On 2013-12-22 21:34 +0100, Campbell Barton wrote:
Hi, we have some icons which are made in inkscape but render differently in RSVG,
Most (all?) of the applications on Linux are using RSVG, so I was wondering if there is a good way to determine if this is some special inkscape feature or a bug/limitation in RSVG.
Comparison:
http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas... http://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/releas...
Note that RSVG seems to fail on groups that have alpha masking.
It appears that librsvg doesn't handle Inkscape's <mask> notation well: when creating a <mask> element, Inkscape always defines 'maskUnits="userSpaceOnUse"' [1], but not the properties 'x', 'y', 'width', 'height' (for the "largest possible offscreen buffer").
AFAICT the SVG 1.1 spec defines relative fallback values (x, y: -10%, width, height: 120%) if the position and size properties are not defined [2], but it's unclear to me how those relate to maskUnits 'userSpaceOnUse'.
librsvg doesn't appear to use fallback values if maskUnits are 'userSpaceOnUse' (setting them explicitly makes the masked objects reappear). If maskUnits are 'objectBoundingBox', or omitted entirely, librsvg renders the masked objects as expected, whether or not position and size of the offscreen buffer are explicitly defined or not.
There's second issue librsvg appears to have with masks in Inkscape-generated SVG files:
Gradients referenced in mask definitions have to be defined earlier, otherwise librsvg doesn't find them and omits the masked objects.
Attached sample files: - test2.svg sample affected icon extracted from blender_icons.svg - test2-gradient-defs-before-mask-def.svg changed stack order of elements in <defs> section - test2-gradient-defs-before-mask-def-no-maskUnits.svg maskUnits ('userSpaceOnUse') removed as workaround (see earlier message)
Only the third version renders with librsvg as expected.
On Tue, 2013-12-24 at 12:20 +0100, su_v wrote:
There's second issue librsvg appears to have with masks in Inkscape-generated SVG files:
We should make sure these two issues are documented in bug reports with their attachments. The stuff here is brilliant and it should be saved in case no one can fix it right away.
Martin,
participants (5)
-
Bryce Harrington
-
Campbell Barton
-
Krzysztof Kosiński
-
Martin Owens
-
su_v