Page 1 of 1

Lost patternTransform during SVG conversion.

Posted: 2011-09-01T14:22:22-07:00
by flyingfox
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:

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>
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.

Re: Lost patternTransform during SVG conversion.

Posted: 2011-09-01T14:24:48-07:00
by fmw42
try installing the RSVG delegate and then IM again and see if that helps. Generally RSVG is more fully functional as I have been told.

You can see which you have installed by

convert -list format

and look at the commend by SVG

Re: Lost patternTransform during SVG conversion.

Posted: 2011-09-01T17:42:45-07:00
by flyingfox
That did it. For some reason I didn't have librsvg2-dev installed (only the -bin package). When that was installed I grabbed the newest source version (6.7.2-1), ran configure with the --with-rsvg option then compiled and installed. Works smoothly now.

Re: Lost patternTransform during SVG conversion.

Posted: 2012-07-21T15:10:15-07:00
by broucaries
Any news of this ? We plan to move debian to internal svg engine

Another test case : https://bugs.launchpad.net/ubuntu/+sour ... bug/824876

Re: Lost patternTransform during SVG conversion.

Posted: 2012-07-28T15:38:44-07:00
by magick
We do not recommend the internal SVG rendering engine. It does a good job with a majority of the SVG elements but is far from complete. Instead we recommend utilizing the RSVG delegate library.