Page 1 of 1

Imagemagick change label font

Posted: 2016-11-30T05:36:08-07:00
by utbl
Is it possible to change the font of a label?

I have following command:

Code: Select all

convert -background none -bordercolor none -gravity west -fill white img1.png label:"1" -border 0x5 +swap -append label:"Kapitel 1" -border 0x5 -append -write miff:- +delete img2.png label:"2" -border 0x5 +swap -append label:"Kapitel 2" -border 0x5 -append -write miff:- +delete img3.png label:"3" -border 0x5 +swap -append label:"Kapitel 3" -border 0x5 -append -write miff:- +delete img4.png label:"4" -border 0x5 +swap -append label:"Kapitel 4" -border 0x5 -append -write miff:- +delete img5.png label:"5" -border 0x5 +swap -append label:"Kapitel 5" -border 0x5 -append miff:- | montage -set label "" miff:- -tile 3x2 -geometry +15-10 -background none result

which creates me an image with 5 image, each image has a text above and under.

I tried following:

Code: Select all

convert -background none -bordercolor none -gravity west -fill white img1.png label:"1" -border 0x5 +swap -append -font 'Candice' label:"Kapitel 1" -border 0x5 -append -write miff:- +delete img2.png label:"2" -border 0x5 +swap -append label:"Kapitel 2" -border 0x5 -append -write miff:- +delete img3.png label:"3" -border 0x5 +swap -append label:"Kapitel 3" -border 0x5 -append -write miff:- +delete img4.png label:"4" -border 0x5 +swap -append label:"Kapitel 4" -border 0x5 -append -write miff:- +delete img5.png label:"5" -border 0x5 +swap -append label:"Kapitel 5" -border 0x5 -append miff:- | montage -set label "" miff:- -tile 3x2 -geometry +15-10 -background none result
Which created me this error in my command line:

convert.exe: unable to read font `'Candice'' @ warning/annotate.c/RenderType/917.

Another question is that my label look bold how can I make them look "normal".(Maybe it is due to the default font)

Re: Imagemagick change label font

Posted: 2016-11-30T07:54:13-07:00
by GeeMack
utbl wrote:Is it possible to change the font of a label? [...] Another question is that my label look bold how can I make them look "normal".(Maybe it is due to the default font)
You can find out which fonts you have installed and available to use in ImageMagick by entering this command at your shell/command prompt...

Code: Select all

convert -list font
You can learn more about changing font attributes at these links: -pointsize, -weight, -style.

Re: Imagemagick change label font

Posted: 2016-11-30T09:33:16-07:00
by utbl
Hi GeeMack I already know that, sorry I forgot to mention that,

if I convert -list font

I does show me the Helvetiva which I want to use, but it still does not work properly.

Does the command work an your system?

Re: Imagemagick change label font

Posted: 2016-11-30T11:22:42-07:00
by snibgo
-font 'Candice'
Why do you have quotes? Why are they single quotes?

Re: Imagemagick change label font

Posted: 2016-11-30T11:26:55-07:00
by GeeMack
utbl wrote:I does show me the Helvetiva which I want to use, but it still does not work properly. [...] Does the command work an your system?
When I try your command using IM 6.9.6 on Windows I get a warning about the font because it's surrounded by single quotes. Since IM doesn't recognize that as an available font, it falls back to whatever it uses as its default font. The command works without warnings if I put double quotes around the font name. It works just as well with no quote marks around the font name as long as there are no spaces or special characters in it.

Re: Imagemagick change label font

Posted: 2016-12-01T02:47:23-07:00
by utbl
Thanks for your post, I tried the command now without quotes and with double quoates but it still looks the same, could you post your image which you created with the command. I am just wondering.

Re: Imagemagick change label font

Posted: 2016-12-01T03:34:07-07:00
by utbl
I think the correct term would be Squashed the text

Re: Imagemagick change label font

Posted: 2016-12-01T11:30:45-07:00
by GeeMack
utbl wrote:Thanks for your post, I tried the command now without quotes and with double quoates but it still looks the same, could you post your image which you created with the command. I am just wondering.
No, it's not really helpful if I post results of a command that works for me. You should post the image that you think has a problem, describe the problem in detail, and maybe even upload the actual font file you're working with. Post the exact errors or warning messages if there are any, and explain what you mean by "squashed" and "looks the same" and "does not work properly". Also let us know which version of ImageMagick you're using and which version of what platform, OS, or shell you're trying to run it on.