Text Offset Probem with SVG 1.1 Specification Example

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
djhreg
Posts: 3
Joined: 2011-11-08T09:56:33-07:00
Authentication code: 8675308

Text Offset Probem with SVG 1.1 Specification Example

Post by djhreg »

Just getting started with SVG coding and ImageMagik and have been delighted so far with the quick, precise and easy rendering of SVG geometric shapes to GIF. However, I just ran into my first problem when I tried to render text. After getting some strange behavior, I decided to just try rendering an example from the SVG 1.1 standard itself.

I picked the example "NewCoordSys" from the section of the specification on translation of coordidates here => http://www.w3.org/TR/SVG/coords.html

This should produce two pieces of text, one rotated slightly and one offset.

I cut and pasted the SVG code into the file X1.SVG.

From the Windows command line, I typed:

convert X1.SVG X1.GIF

It ran instantly with no errors. However, when I look at the GIF, the text is not in the right place. In both coordinate systems (two are shown) it is about 3 ems down and 3 ems to the right of where it should be. This problem is quite similar to the problem I was having in my own piece of SVG.

I installed from ImageMagick-6.7.3-2-Q16-windows-dll.exe (recommended default). I happen to be using Windows XP, but the behavior is the same on my Windows 7 machine.

Is there some configuration step I need to take or additional command line option I need to include?

Thanks!

David Hetherington
Austin, Texas, USA
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Text Offset Probem with SVG 1.1 Specification Example

Post by fmw42 »

I am not an expert on SVG nor am I a windows user. But you might try installing the RSVG delegate library (if that is possible on windows) rather than using the built-in SVG.

convert -list format
...
SVG SVG rw+ Scalable Vector Graphics (RSVG 2.34.1)
SVGZ SVG rw+ Compressed Scalable Vector Graphics (RSVG 2.34.1)
...


Strange! I tried that example and all I get with RSVG is a blank white image. IM 6.7.3.4 Q16 Mac OSX Tiger
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Text Offset Probem with SVG 1.1 Specification Example

Post by magick »

We can reproduce the problem you posted and will have a patch within a few days. Thanks.
davezachry
Posts: 1
Joined: 2012-01-31T10:49:03-07:00
Authentication code: 8675308

Re: Text Offset Probem with SVG 1.1 Specification Example

Post by davezachry »

I was curious if there was any resolution to this issue.

I have the same issue, I believe. I have an SVG file that has text placed at a specific place and looks correct in an image editor. But when I convert it to a PNG, the text is not positioned correctly.

I am using the latest version of Imagemagic.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Text Offset Probem with SVG 1.1 Specification Example

Post by magick »

We're using ImageMagick 6.7.5.0 and the text appears to render properly. We'll need you to define "the text is not positioned correctly" and we'll investigate further.
djhreg
Posts: 3
Joined: 2011-11-08T09:56:33-07:00
Authentication code: 8675308

Re: Text Offset Probem with SVG 1.1 Specification Example

Post by djhreg »

After upgrading to ImageMagick-6.7.4-7-Q16 on 19 January 2012, my original problem was fixed. The testcase extracted from the SVG specification now formats correctly.

Thanks,

David Hetherington
Post Reply