Font With Space in don't work... Need solution urgently..

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
gauravsharma85

Font With Space in don't work... Need solution urgently..

Post by gauravsharma85 »

Hi All,

I m trying to generate images of text on whatever user writes in the textbox. We have given the ability to user that he/she can select font also. I m using this command:

convert -background none -fill 0 -font "Stencil" -pointsize 17 -size 150x47.2 -gravity northwest caption:"Testing Sample Data" F:\Projects\WIS\GREETWELL\Source\UserFiles\designs\User\TextImages\739ab274-b321-48a8-af3c-b909d7140750.png

Now in the above command i used font as
-font "Stencil"
it works successfully.

But if user selects a font which has space in name like:
"Lucida Handwriting" or "Arial Black"
then image magick gives error.

I tried this ImageMagick-6.0.1-Q16 and then on ImageMagick-6.3.7-Q16. Can somebody suggest a solution.

Thanks,
Gaurav Sharma
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Font With Space in don't work... Need solution urgently..

Post by Bonzo »

Do your font names actualy have spaces ? My font list is displayed here with an example of how to find your installed fonts.

http://www.rubblewebs.co.uk/imagemagick ... /fonts.php
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Font With Space in don't work... Need solution urgently..

Post by fmw42 »

check to see what fonts IM recognizes and how the name has been changed (usually compressed to remove space)

convert -list font (newer releases)
convert -list type (older releases)

For example on my system Arial Black shows up in the list as ArialBk
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Font With Space in don't work... Need solution urgently..

Post by el_supremo »

In general on Windows if the font name has a space in it, then in IM the space is replaced by a hyphen.
So, "Lucida Handwriting Italic" becomes "Lucida-Handwriting-Italic".
You would still have to check that the font exists in some cases because "Lucida Handwriting" doesn't exist on my system whereas "Lucida Handwriting Italic" does.

Pete
Post Reply