Hi!
I've implemented the rendering of SVG2 hatches in lp:~penginsbacon/inkscape/svg-paints-support. How it works can be seen using a test file attached to this message. The rectangles in left columns are filled with hatches, while the ones in right columns are reference images consisting of clipped paths.
What is still to be done is to implement rendering when overflow property is set visible. In addition to this, I have to improve rendering when hatch covered object is zoomed out.
The second problem can be seen in the picture [1]. The cause is aliasing when rendered cairo_pattern_t is applied to a shape. One of the solutions is to adjust applied pattern size to full pixels. This can be achieved by manipulating the transformation applied to the pattern by ink_cairo_pattern_set_matrix in drawing-pattern.cpp:119. The drawback of this rendering hatch paths at displaced positions, what can be visible in case of large shapes. Another solution is to allocate pattern surface of the size of object bounding box and to draw all hatch paths on it. The third one is to increase oversampling and use CAIRO_FILTER_NEAREST for hatches.
What techique do you recommend?
I'd like to add hatches to Swatches and Fill and Stroke dialogs and prepare stock hatches based on ISO 128-50 standard being used in Europe for technical drawing.
As there are more SVG2 elements supported in Inkscape, how should fallback to SVG1.1 look like? Should there be an another output extension? In case of hatches should they be converted to patterns?
Regards Tomasz