2013/10/28 mathog <mathog@...1176...>:
SVG supports both clipping and filters. Some other formats do as well, for instance, EMF+, (although the supported filters do not match very well between SVG and EMF+).
I can see how one would convert those features from other graphics formats to SVG during import (more or less).
However, for output to another file type I do not see where either the clipping or filters would be passed, perhaps buried in style?
I thought that maybe the clipping was applied upstream somehow, so that the driver level would just draw what was left, but could not test the idea because it seems that clipping has some problems in Trunk right now.
I think the API used to implement WMF/EMF export does not support clipping at all.
There are in fact 4 distinct ways to implement an output extension in Inkscape:
1. Use the interactive, bitmap-oriented Cairo renderer (the show() / hide() functions, and the objects in src/display) - this is used for canvas, PNG export, icon previews. 2. Use the offline, vector-oriented Cairo renderer (src/extension/internal/cairo-*) - this is used for PDF / PS export. 3. Use the print functions on SPObjects via print.h - this is used by WMF / EMF export and one more output extension, but I don't remember which one. 4. Directly access the SP tree to extract the relevant information.
Approaches 1 and 2 support clipping, 4 supports it if you implement it, while 3 does not support it at all; there is no print function on clipping paths or masks.
The 100% proper way to support WMF / EMF export would be to create a Cairo backend for this, but that's rather hard and requires working closely with upstream - Cairo doesn't support user backends.
Regards, Krzysztof