Page 1 of 1

[Fonts] Load a font dynamically

Posted: 2008-06-17T01:44:04-07:00
by t-servi
Hello,
I have ImageMagick 6.2.3 and I want to load font for IM. How can I do that?
Best regards.
Jean Tinguely Awais.

Edit : I'm on Linux.
Edit : In fact is it possible to dynamicaly load a font like this :
convert -font font1.ttf ....

Re: [Fonts] Load a font dynamically

Posted: 2008-06-18T20:12:02-07:00
by anthony
You either use the font directly using -font path/to/font/file.ttf Or you specify the font in the system "type.xml" or personal "type.xml" file.

A script is on the IM Example home page for linux/mac systems that will generate a "type.xml" file containing all fonts that it can find on a machine using the 'locate' command.

http://imagemagick.org/Usage/#font

Re: [Fonts] Load a font dynamically

Posted: 2008-06-18T23:51:52-07:00
by t-servi
Hello,
Thank you.
Well I try it :

Code: Select all

convert -font  /media/druckerbereich/fonts/gillsans.ttf  -pointsize 72 label:Test test.gif
but IM says :
convert: unable to read font `/media/druckerbereich/fonts/gillsans.ttf'.
I have missinstalled something but I don't know what. Do you know what it could be?
Best regards.
Jean Tinguely Awais.

Re: [Fonts] Load a font dynamically

Posted: 2008-06-19T01:35:53-07:00
by t-servi
Hello,
Now It's working. My path was false :oops:
Best regards.
Jean Tinguely Awais.

Re: [Fonts] Load a font dynamically

Posted: 2008-06-19T16:32:32-07:00
by anthony
Of course if you update one of the type.xml files you don't need a path. You can have a personal type.xml that will add more fonts to the ones defined in the system type.xml

Re: [Fonts] Load a font dynamically

Posted: 2008-06-20T00:14:37-07:00
by t-servi
Hello,
OK, I understand the system of the type.xml, I have tried it. But in this fall, the programm needs to call dynamicaly the font. And it works. Thank you ImageMagick and thank you for your answer.
Best regards.
Jean Tinguely Awais.