Using other svg delegate

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?".
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Using other svg delegate

Post by tsdineen »

I am using The ImageMagick that comes with Red Hat 6.7. It is picking up the librsvg shared object to convert svg material. The verison of rsvg installed on the rh6 machine, as well as the latest version, fail to convert the text on the page properly. I am able to view this thorugh gwenview and convert it through ksvgtopng properly.

Since the latest version is bad and it would be a pain to have the fix patched and deployed, is there a way to change the delegate? I tried used the delegate.xml file, but I noticed the librsvg-2.so was being picked, and the delegates.xml wasn't even being opened.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Using other svg delegate

Post by fmw42 »

I am not an svg expert, but if you install Inkscape, I believe that IM will use that as its first choice. I understand that Inkscape does better than RSVG, which does better than IM MSVG.

Perhaps you can provide your exact command and the svg file, so others can test.

You can override the RSVG delegate with the internal MSVG by doing

Code: Select all

convert MSVG:somefile.svg result.suffix
Though generally RSVG is better than MSVG.

Also you might identify the version of SVG and Imagemagick.

Code: Select all

convert -version
will tell you what version of Imagemagick is being used.

Code: Select all

convert -list format
will tell you which version of RSVG is being used. For example:


SVG SVG rw+ Scalable Vector Graphics (RSVG 2.40.12)
SVGZ SVG rw+ Compressed Scalable Vector Graphics (RSVG 2.40.12)
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: Using other svg delegate

Post by tsdineen »

All of my conversions are done in the api, not in the tools. the simple observation is

display my.svg

Where there are several fonts being used and various UTF8 characters.

display -version
Version: ImageMagick 6.7.2-7 2015-02-27 Q16 http://www.imagemagick.org

so my tool links in libMagickCore.so.5.0.0

I installed inkscape, but it doesn't work either. Only gwenview and ksvgtopng completely.

I was hoping this could be overwritten by the delegates file, so I could use a tool that works.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Using other svg delegate

Post by fmw42 »

Perhaps you should post your svg file so others can test with it or examine it. You also have not provided your version of RSVG.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Using other svg delegate

Post by snibgo »

tsdineen wrote:I installed inkscape, but it doesn't work either.
What does Inkscape say? Any error message?

Perhaps your SVG file is bad.
snibgo's IM pages: im.snibgo.com
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: Using other svg delegate

Post by tsdineen »

No, it didn't covert the unicode character properly.
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: Using other svg delegate

Post by tsdineen »

I would like to note, this file views properly with gwenview, firefox, display (if converted using ksvgtopng).
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Using other svg delegate

Post by fmw42 »

I do not think we can help much more without having the file to test. If it is proprietary, can you provide some other svg file that has the same issue?
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: Using other svg delegate

Post by tsdineen »

You can find the sample svg here.

ftp://ftp.sas.com/outgoing/ImageMagick/ansg011.svg

Note: this is only a problem with the rsvg product.

The
Z=31.6

should be like
̿X=31.6

Which is a Combining Double Overline + Capital X. You may have issues seeing this, if you Linux box doesn't have the correct fonts.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Using other svg delegate

Post by snibgo »

Inkscape v0.91 complains:

Code: Select all

** (inkscape.exe:3624): WARNING **: unknown type: svg:font-face-src
I can't find "font-face-src" in the SVG 1.1 standard.

Inkscape displays "Z=31.6".

The SVG code refers to fonts that I don't have on my system. If it uses glyphs that aren't in my default font, they will display incorrectly (obviously).
snibgo's IM pages: im.snibgo.com
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: Using other svg delegate

Post by tsdineen »

Sorry, I'm not sure what font that is, but it is part of our product.

Here is what happens when I run rsvg-convert
ftp://ftp.sas.com/outgoing/ImageMagick/rsvg.png

and when I run ksvgtopng
ftp://ftp.sas.com/outgoing/ImageMagick/ksvgto.png

As you can see, the ksvgtopng is picking up the font, rsvg and inkview do not.

Using the latest rsvg on Fedora 23, v2.40.15, finds the double over bar character correctly, but doesn't convert the Greek alpha in the upper right corner of the graph.

This is clearly a rsvg issue, but my request is how do I override the use of rsvg in ImageMagick shared libraries to something in the delegates.xml?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Using other svg delegate

Post by snibgo »

tsdineen wrote:how do I override the use of rsvg in ImageMagick shared libraries to something in the delegates.xml?
You can create your own entries in delegates.xml. Better, create your own personal delegates.xml ("-debug all" will tell you where IM tries to find it). This entry could use a prefix of, say, "KSVG". Then, when you run ...

Code: Select all

convert KSVG:in.svg out.png
... your delegate command will be run, to execute ksvgtopng or whatever you want.
snibgo's IM pages: im.snibgo.com
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: Using other svg delegate

Post by tsdineen »

I don't use convert, so how do you make this work through the api?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Using other svg delegate

Post by snibgo »

The same delegates mechanism works for both. If you can use convert, it will quickly tell you where it searches for delegates.xml. Otherwise, you should read the documentation.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Using other svg delegate

Post by fmw42 »

If you don't use convert, what are you using and how does that relate to Imagemagick? Do you mean you are using one of the API's rather than command line?
Post Reply