Problems wit underlines and italics.

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
angelhm
Posts: 3
Joined: 2019-03-22T02:00:00-07:00
Authentication code: 1152

Problems wit underlines and italics.

Post by angelhm »

Hi guys!

First, thanks in advance!

I got a few problems printing to a PDF file with imagemagick command line. Here is my command:

Code: Select all

        $command = "convert /tmp/diseno.svg -gravity northwest -density 150x150 -repage ".$repage.$offsetLeft.$offsetTop."\!   /tmp/diseno.pdf";
And these are my problems:

Problems with Italics and Underlines

I also have another problem, when I set on my SVG a font to be Italic or Underline it is not print on the PDF; I can see on SVG the propiety text-decoration with the values underline and line-through:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1240" height="1754" viewBox="0 0 1240 1754" xml:space="preserve">
<desc>Created with Fabric.js 2.4.3</desc>
<defs>
</defs>

<g transform="matrix(1 0 0 1 657 316.3)" style=""  >
		<text xml:space="preserve" font-family="averia serif libre" font-size="20" font-style="normal" font-weight="normal" text-decoration="underline line-through " style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;" ><tspan x="-150" y="6.28" >E</tspan><tspan x="-137.64" y="6.28" >s</tspan><tspan x="-128.89" y="6.28" >c</tspan><tspan x="-119.36" y="6.28" >r</tspan><tspan x="-110.77" y="6.28" >i</tspan><tspan x="-104.62" y="6.28" >b</tspan><tspan x="-93.38" y="6.28" >e</tspan><tspan x="-83.44" y="6.28" style="white-space: pre; "> </tspan><tspan x="-78.36" y="6.28" >e</tspan><tspan x="-68.42" y="6.28" >l</tspan><tspan x="-62.43" y="6.28" style="white-space: pre; "> </tspan><tspan x="-57.34" y="6.28" >t</tspan><tspan x="-50.1" y="6.28" >e</tspan><tspan x="-40.29" y="6.28" >x</tspan><tspan x="-29.48" y="6.28" >t</tspan><tspan x="-22.24" y="6.28" >o</tspan><tspan x="-11.36" y="6.28" style="white-space: pre; "> </tspan><tspan x="-6.27" y="6.28" >a</tspan><tspan x="4" y="6.28" >q</tspan><tspan x="15.36" y="6.28" >u</tspan><tspan x="27.13" y="6.28" >í</tspan></text>
</g>
</svg>
Can you give me some advice guys?? I'm quite desperate :D :D
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problems wit underlines and italics.

Post by fmw42 »

This works for me on IM 6.9.10.34 Q16 Mac OSX with Inkscape as the SVG renderer that ImageMagick uses.

Code: Select all

convert -density 300 test.svg test.png
ImageMagick can use 3 different renderers for SVG: Inkscape (the best), RSVG delegate (second) and MSVG/XML (worst).

You can tell if you have RSVG or MSVG/XML from

Code: Select all

convert -list format
and look at the end of the line for SVG.

You are likely using XML/MSVG, which is the ImageMagick internal SVG renderer. Try installing Inkscape and IM will use it automatically if using a current version. Otherwise, install RSVG delegate with Imagemagick

Please always identify your IM version and date of version and platform from

Code: Select all

convert -version
angelhm
Posts: 3
Joined: 2019-03-22T02:00:00-07:00
Authentication code: 1152

Re: Problems wit underlines and italics.

Post by angelhm »

Hello fmw42! Thanks for your response.

First I checked my version:

Code: Select all

...$ convert -version
Version: ImageMagick 7.0.8-16 Q16 x86_64 2018-12-13 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff wmf x xml zlib
Then, I ran:

Code: Select all

convert -list format | grep SVG
and the output is:

Code: Select all

...n.com$ convert -list format |grep SVG
     MSVG  rw+   ImageMagick's own SVG internal renderer
      SVG  rw+   Scalable Vector Graphics (XML 2.9.4)
     SVGZ  rw+   Compressed Scalable Vector Graphics (XML 2.9.4)
I guess that I have the worst option.

I'm looking for instructions about how to install inkscape but I can not find anything, can you give me some information about?

I work on Ubuntu 16.04.4 LTS and Nginx server.

Thanks in advance.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Problems wit underlines and italics.

Post by snibgo »

I'm looking for instructions about how to install inkscape but I can not find anything, can you give me some information about?
See https://inkscape.org/
snibgo's IM pages: im.snibgo.com
angelhm
Posts: 3
Joined: 2019-03-22T02:00:00-07:00
Authentication code: 1152

Re: Problems wit underlines and italics.

Post by angelhm »

snibgo wrote: 2019-03-27T07:02:13-07:00
I'm looking for instructions about how to install inkscape but I can not find anything, can you give me some information about?
See https://inkscape.org/
I thought that the installation on the server was different but now I have it properly installed. I need to change my command because the paper size was broke off but I think I can fix it with density and repage attrs!

So many thanks for your help guys.
Post Reply