Page 1 of 1

Conjure Script

Posted: 2015-07-28T10:09:59-07:00
by JonnyRobbie
I'm having some problems getting to work a conjure script work properly.

Code: Select all

$ cat con_script.msl 
<?xml version="1.0" encoding="UTF-8"?>
<image>
        <read filename="image.png" />
        <draw primitive="rectangle" stroke="#f00" fill="#0f0" x="10,20" y="30,40" />
        <draw primitive="text" fill="#00f" text="sample text" x="100" y="100" font="GohuFont" />
        <annotate text="lorem ipsumR" family="GohuFont" x="10" y="30" pointsize="6" antialias="false"/>
        <write filename="image.png" />
</image>
$ ls
con_script.msl  image.png
$ conjure con_script.msl
I have prepaded a 512x512 pure white image.png beforehand.
  1. The annotate command does render text, but the font is incorrect. It does not render it in GohuFont, but what I think is Nimbus Sans. It may entirely be possible that the font is not correctly configured, but GohuFont works as my terminal font as well as if I try to change it in Firefox, so I think it might be configured right.
  2. The draw command does not seem to work. Not even one of the both primitive types.
Honestly the examples here http://imagemagick.org/www/conjure.html seem to be somewhat insufficient for me. Do I hove some error in the script or in the conjure arguments?

Code: Select all

$ uname -roms && conjure -version && fc-match "GohuFont"                                                     
Linux 4.1.2-2-ARCH x86_64 GNU/Linux                                                                                                       
Version: ImageMagick 6.9.1-8 Q16 x86_64 2015-07-14 http://www.imagemagick.org                                                             
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC                                                                                 
License: http://www.imagemagick.org/script/license.php                                                                                    
Features: Cipher DPC HDRI Modules OpenCL OpenMP                                                                                           
Delegates (built-in): bzlib cairo fontconfig freetype gslib jng jp2 jpeg lcms lqr ltdl lzma pangocairo png ps rsvg tiff webp wmf x xml zlib                                                                                                                                         
                                                                                                                                          
gohufont-11.pcf.gz: "GohuFont" "Regular"
Image

Re: Conjure Script

Posted: 2015-07-28T10:21:53-07:00
by magick
We can reproduce the problem you reported, give us a day or two to investigate and get back with you.

Re: Conjure Script

Posted: 2015-07-28T10:31:52-07:00
by JonnyRobbie
magick wrote:We can reproduce the problem you reported, give us a day or two to investigate and get back with you.
Do you mean the font issue, or even the draw issue? Thanks for looking into it.

Re: Conjure Script

Posted: 2015-07-28T10:38:37-07:00
by magick
Try this for a rectangle:
  • <draw primitive="rectangle" stroke="yellow" fill="cyan" points="10,20 60,40" />
Type
  • convert -list font
Is GohuFont listed as a font? ImageMagick defaults to Arial if it can't find the font you specify.

The documentation need improving of course. Conjure is supported and we do fix issues as they arise.

Re: Conjure Script

Posted: 2015-07-28T10:56:17-07:00
by JonnyRobbie
Gohu is indeed not listed

Code: Select all

$ convert -list font | grep Gohu
returns nothing.

Your suggested draw methid works, thank you. I have an additional question though. The draw primitive text works only if the text is part of the primitive attrubute, but it does not work if it's a part of text attribute.

Code: Select all

<draw primitive="text 80,90 'lorem ipsumRR'" fill="#00f" family="GohuFont" pointsize="6" antialias="false"/> works (wrong font though), but
<draw primitive="text 80,90" text="lorem ipsumRR" fill="#00f" family="GohuFont" pointsize="6" antialias="false"/> does not
Why is that?

Re: Conjure Script

Posted: 2015-07-28T11:01:41-07:00
by JonnyRobbie
Ok, thank you very much.

Re: Conjure Script

Posted: 2015-07-28T11:13:30-07:00
by magick
With the 6.9.2-0 patch available tomorrow, this will work:
  • <draw primitive="text" points="100,100" fill="blue" stroke="black" text="sample text" font="GohuFont" />

Re: Conjure Script

Posted: 2015-07-28T11:33:26-07:00
by JonnyRobbie
just one more question. Will it be a general font fix or just Gohu fix? Because I have the same problem with another font:

Code: Select all

$ convert -list font | grep "Clean"                                                                        
$ fc-match "Clean"                                                                          
clR6x12-ISO8859-1.pcf.gz: "Clean" "Regular"

Re: Conjure Script

Posted: 2015-07-28T13:51:39-07:00
by magick
See http://www.imagemagick.org/Usage/ near the bottom of the page under Font Usage. There is a script that finds all the fonts on your system and makes them available to ImageMagick.

Re: Conjure Script

Posted: 2015-07-28T14:41:42-07:00
by fmw42