Lost patternTransform during SVG conversion.
Posted: 2011-09-01T14:22:22-07:00
I'm running into a bit of trouble when converting SVG files with defined patterns that have a rotated transform. The minimal test case is:
I've tested this with Inkscape (a SVG editor) and evince (document viewer) and I get the a box with hashwd 45 degree lines. When I use convert (Version: ImageMagick 6.5.7-8 2010-12-02 Q16) under Ubuntu 10.04 LTS the 45 degree rotation in the pattern is lost. The result is a box filled with vertical lines. This is true no matter what output format is specified (png, jpg, and pdf tested).
The format info page states that libxml2 and Free Type 2 are required. Both are installed (libxml2 2.7.6, Free Type 2 2.3.11). I understand that SVG support is incomplete and I can work around this for right now.
Code: Select all
?xml version="1.0" ?>
<!DOCTYPE svg
PUBLIC '-//W3C//DTD SVG 1.1//EN'
'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg height="200.0" version="1.1" width="200.0" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern height="9" id="test_hash" patternTransform="rotate(45) " patternUnits="userSpaceOnUse" width="9">
<path d="M 5 0 V 9" stroke="black" stroke-width="1"/>
</pattern>
</defs>
<polygon fill="url(#test_hash)" points="10 10, 10 100, 100 100, 100 10" stroke="black" stroke-width="1"/>
</svg>
The format info page states that libxml2 and Free Type 2 are required. Both are installed (libxml2 2.7.6, Free Type 2 2.3.11). I understand that SVG support is incomplete and I can work around this for right now.