[cairo] Output SVG with fill and alpha stroke, but without inline images ?

Stuart Axon stuaxo2 at yahoo.com
Thu Mar 25 00:19:09 UTC 2021


I've been poking at the cairo source code to see if it's possible, but haven't worked it out yet.
To test how various apps render something like this, I created this SVG:https://www.svgshare.com/s/VPP
It's a rectangle with a stroke with alpha.For everything I tried on Linux, the stroke has two colours, because half of it is over where the fill draws to, and that shows through.
I think there's a fair chance everything I tried (Firefox, Chrome (Linux), Edge (Linux)), may have actually used cairo.
This is probably out of cairos scope, but:
I can't imagine a use-case where someone creating an svg with both fill and stroke is set would expect a 3rd colour to be generated where part of the stroke overlays the fill (it makes sense in cairo, but shouldn't in SVG).
Anyway, I guess I should file bugs upstream for this.


S++ 

    On Wednesday, March 24, 2021, 1:22:25 AM GMT, Stuart Axon <stuaxo2 at yahoo.com> wrote:  
 
 I've been trying to generate an SVG using SVGSurface with a fill and an alpha stroke, 
with OPERATOR_SOURCE to ensure the stroke draws over the fill, but this seemsto generate <image> tags in the SVG.
Toy example and output + XML:
https://gist.github.com/stuaxo/b525a47d33f5f3074b1be7c693f6b6e6
Is there any way to render fill + stroke (with alpha) and only output vector data ?This seems like a common operation, but whatever I try outputs SVGs full of <image>s.

For Shoebot, this has meant our SVGs become very very large, enough to eat all your ram if you try and open them in Inkscape.
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20210325/021f3815/attachment.htm>


More information about the cairo mailing list