imagemagick extra fonts needed

Asked by Peter on 2009-07-24

Hi I have been using imagemagick lately and am impressed.
However I can only use default fonts. Shown is an illustration of the error for extra fonts

peter@peter-desktop:~$ convert -background lightblue -fill blue -font Candice \
> -size 165x70 -gravity center label:Anthony label_size_gravity.gif
convert: unable to read font `Candice' @ magick/annotate.c/RenderType/1066.

I am actually using it to annotate images from a perl script but the error is the same. How can I get Verdana font for imagemagick?
Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu imagemagick Edit question
Assignee:
No assignee Edit question
Solved by:
Peter
Solved:
2009-07-25
Last query:
2009-07-25
Last reply:
2009-07-25
Peter (nitep) said : #2

Verdana font is of course already on my system. How do I make it available to imagemagick's convert program?
I use Verdana font on my website and in open office.

Have you already tried to install msttcorefonts package... it install basic ms core fonts i don't remember if there is also some Verdana font in it but please try.

Please first enable the universe repository:

Open System → Administration → Software sources → [ Tab Ubuntu software ]
enable "Community Maintained open source software (universe)"
Close and confirm the repository reload.

To install this fonts please open a Terminal from the menu Applications → Accessories → Terminal and type:
(if the system ask you a password give your user password, you will not see nothing when you type it, then press enter)

sudo apt-get update
sudo apt-get install msttcorefonts

Hope this helps

Larry Jordan (larryjor) said : #4

     I would guess no one here is that familiar with imagemagick. After a quick search on the imagemagick website at
http://www.imagemagick.org/script/search.php it looks to me like their community has accomplished this already, but help on how to do it isn't READILY located. Sorry to reroute you, but perhaps you should join their community (as well) and ask them.

Peter (nitep) said : #5

Marcobra, I installed msttcorefonts when I upgraded to 9.04

Larry, Thanks. I will try that so will close this query

Peter (nitep) said : #6

I finally got it working by trying the full path name to the font:-
convert -background lightblue -fill blue -font /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf \
          -size 165x70 -gravity center label:Anthony label_size_gravity.gif

I use it :-
system("convert $back -gravity center -font /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf -stroke black -strokewidth $w -pointsize $l -annotate 0 '\@$out2' -font /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf -stroke none -fill white -pointsize $l -annotate 0 '\@$out2' temp/temp$i.jpg");

as part of a perl script where out2 is a file handle and $w $l are calculated from the longest line of the text to scale it to fit.