On Tue, 04 Jan 2011 12:17:38 -0500
[email protected] wrote:
| I'm trying to add some text to my images that are being
| hot-linked from other websites.
| 
| Adding the text works OK, however the images vary wildly in size, and  
| once they're scaled in the browser, the text becomes illegible, so,  
| I'd like to size the text to be a percentage of the image height, not  
| a fixed point size.
| 
| For example, if the image is 400px high, I'd like 40px text. If the  
| image is 4000px high, I'd like 400px text.
| 
| Can anybody toss me a clue on how I can accomplish this?
| 
| My current command is:
| 
| convert "test.gif"
| -font "/path/to/font/Loma.ttf"
| -pointsize 32
| -geometry x500
| -gravity NorthWest
| -draw "text 4,4 'This text goes on the image'" gif:-
| 
| Any suggestions?

Set a label -size limit instead of a point size, and text of the right
size will be generated to fit.

See IM Examples, Text Labels, Best fit
  http://www.imagemagick.org/Usage/text/#label_bestfit

Also note that pointsize represents the text linespacing, at the
current density or resolution (72 by default).  however actual
size of the draw text on a line does not actually have any bearing
on the pointsize.  It depends on what the creator of the font defined.

See the section on Pointsize
  http://www.imagemagick.org/Usage/text/#pointsize

  Anthony Thyssen ( System Programmer )    <[email protected]>
 --------------------------------------------------------------------------
    Occult Primer... Chapter Fifteen... Elementry Necromancy
    Lesson One:  Correct use of a Shovel         -- Terry Pratchett, "Jingo"
 --------------------------------------------------------------------------
   Anthony's Castle     http://www.cit.griffith.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to