Page 1 of 1

Convert SVG to PNG with special characters

Posted: 2017-12-08T03:45:14-07:00
by amcoello
Hi,

I have the following svg file "in.svg":

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="500" height="200" 'viewBox="0 0 500 200">

<text x="0" y="0" font-size="14">A Á E É</text>
</svg>

In command line: "convert in.svg out.png"

The output file does not correctly represent the special characters of the text.

how can I solve that?

Thank you very much to all!

Re: Convert SVG to PNG with special characters

Posted: 2017-12-08T04:13:03-07:00
by snibgo
What version of IM? On what platform? What delegate is rendering your SVG? What output do you get?

Re: Convert SVG to PNG with special characters

Posted: 2017-12-08T04:34:05-07:00
by amcoello
Hi,

The version of IM is:

Version: ImageMagick 6.9.4-9 Q16 i386 2016-06-21 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC
Delegates (built-in): bzlib freetype gslib jng jpeg png ps tiff xml zlib


The platform is Linux (hosting with STRATO).

The output is: AA E A

Characters without accents work well, but those with accents do not show them or show them wrong.

What do you mean by "Which delegate is your SVG representing?"

Thanks!

Re: Convert SVG to PNG with special characters

Posted: 2017-12-08T04:53:47-07:00
by snibgo
On SVG rendering, see http://www.imagemagick.org/Usage/draw/#svg

Does Inkscape correctly process the SVG? If it does, then I suggest you use that as the IM delegate. If it doesn't, there's a problem with your SVG file.

Re: Convert SVG to PNG with special characters

Posted: 2017-12-10T15:44:22-07:00
by amcoello
When i put: convert -list delegate | grep svg

The result is:

cdr => "uniconvertor' '%i' '%o.svg'; /usr/bin/mv '%o.svg' '%o"
cgm => "uniconvertor' '%i' '%o.svg'; /usr/bin/mv '%o.svg' '%o"
dot => "dot' -Tsvg '%i' -o '%o"
dxf => "uniconvertor' '%i' '%o.svg'; /usr/bin/mv '%o.svg' '%o"
fig => "uniconvertor' '%i' '%o.svg'; /usr/bin/mv '%o.svg' '%o"
svg => "rsvg-convert' -o '%o' '%i"


How can i use "rsvg-convert' ?

Re: Convert SVG to PNG with special characters

Posted: 2017-12-10T16:07:36-07:00
by snibgo
The last line says that the external delegate for *.svg files is a program called rsvg-convert. If you don't have that program, it won't be used.

I suggest you install Inkscape, which is (as far as I know) the most complete rasterizer of SVG.