Giet on  wrote...
| Giet <[EMAIL PROTECTED]> sent the following
| ------------------------------------------------------------
| I would ask onto the forum:
| "
| Hello,
| 
| I would like to generate image from txt using non proportional font (Verdana 
7).
| My image is widht=160, height =70
| Sometimes the text is too long even on two lines.
| How can i know, with ImageMagick, the length of text (in pixels) according to 
the font and size?
| 

If you are using an API you have access to the font attributes
functions.  I don't however use an API normally so I don't know the
details directly, see the manual.

For command line you can get a basic idea using methods details in
IM Examples, Text, Determining Font Metrics
  http://www.cit.gu.edu.au/~anthony/graphics/imagick6/text/#font_info

Just substitute the whole string for your tests.

Now actually generating images to find simple attributes is of course a
couple of orders of magnitute slower than using an API.


  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
  for a in past present future; do
    for b in clients employers associates relatives neighbours pets; do
      echo The opinions in this article in no way reflect the opinions of $a $b
  done;done
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to