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