Skip to main content
Inspiring
October 14, 2008
Question

Multiline Text to Image - Centered

  • October 14, 2008
  • 2 replies
  • 691 views
How can I draw multiple line of text onto an image? This is what I've found online so far that also allow the text to be centered ...
This topic has been closed for replies.

2 replies

Inspiring
October 15, 2008
Assuming you know the text will fit within the image dimensions, Raymond Camden's blog mentions an entry by Ben Nadel for drawing and wrapping multiple lines of text. You might also check over at riaforge.org for image related cfc's.

http://www.coldfusionjedi.com/index.cfm/2008/1/16/ColdFusion-8-Image-functions-and-text-size
http://www.bennadel.com/blog/977-ColdFusion-8-ImageDrawTextArea-Inspired-By-Barney-Boisvert-.htm

I also wrote an entry about using a java object (LineBreakMeasurer) to draw and wrap text on an image.
http://cfsearching.blogspot.com/2008/01/text-wrapping-with-images-and.html

Bear in mind, if you need to shrink the text to fit the image dimensions it is a bit more complicated.
Inspiring
October 15, 2008
romeogq wrote:
> I have a situation where I need test rotated by 90 degrees. There is no way for
> me to do this via CSS, so I would like to know if it is possible to create an
> image (cfimage maybe) containing the text I need to be rotated by 90 degrees

have a look at imageRotateDrawingAxis & imageDrawText