Sasa Ebach wrote:
> Hi Tim,
> 
> I have a question about RMagick. Since it uses a c-interface to 
> imagemagick I wonder if if implements the multi-line text by? Something 
> that can be done on the command-line with
> 
> convert -background lightblue -fill blue \
>         -font Ravie -pointsize 24 -size 200x \
>         caption:"This is a really long line which will hopefully wrap" \
>         caption_multi_line.gif
> 
> I couldn't find this in the documentation. (Maybe I haven't looked hard 
> enough). Does RMagick do it and where can I find this in the c-source? I 
> am asking out of interest for implementing the same thing in the 
> corresponding module in PHP. (To be exact, to point the guys that do 
> maintain the PHP module to RMagick, since they say that it is not easily 
> possible.
> 
> -se
> 
> 

This is the "caption:" image format and yes, RMagick supports it. See 
http://www.simplesystems.org/RMagick/doc/imusage.html#builtin_formats.

There's not really a separate API for it. You just specify "caption:" as 
the prefix to the "filename" when you read the image. Normally the 
"filename" is the caption text, but if it starts with an "@" then IM's 
ReadImage function treats it as the name of a file from which to get the 
caption string. Like this:

caption:This is my caption
caption:@caption.txt

In C, just store "caption:whatever" into the ImageInfo.filename field, 
along with all the other attributes (background, fill, etc.) in the 
appropriate ImageInfo fields and then call ReadImage.

In RMagick this happens in the rd_image function in rmimage.c. Tell your 
PHP guys that RMagick uses the MagickCore API. If they're using the 
MagickWand API there are different but parallel functions.

The PHP guys can email directly if they have questions.

-- 
RMagick OS X Installer [http://rubyforge.org/projects/rmagick/]
RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618]
RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]