[cairo] Output SVG with fill and alpha stroke, but without inline images ?
psychon at znc.in
Thu Mar 25 16:06:36 UTC 2021
Am 24.03.21 um 02:22 schrieb Stuart Axon:
> 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:
> 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.
I ported your example code to C (attached). Don't ask me why, but I
experimented with the SVG version. And it helped!
More specifically, adding this line:
...causes a small difference in the output with/without operator SOURCE:
The path's style gets a new "comp-op:src;clip-to-self:true" entry.
Everything else stays the same (well, except the header saying
version="1.2" instead of the previous version="1.1").
So, I do not really have much clue about SVG, but I guess this means that:
- cairo defaults to SVG 1.1
- SVG 1.1 does not support operator SOURCE
Homophobia - The fear that another man will treat you the way you treat
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 644 bytes
Desc: not available
More information about the cairo