> I am looking for something like the getdimensions() method from 
> cfx_imageflare
> http://efflare.com/products/cfx_imageflare/documentation/font.html

My first response did not show up, so I am resending. 

Anyway, you might try java.awt.font.TextLayout. I do not think CF image objects 
retain the font after calling ImageDrawText. So you may have to create a Font 
object to obtain the correct dimensions.

<cfscript>
   buffered = ImageGetBufferedImage(theColdFusionImage);
   context = buffered.getGraphics().getFontRenderContext();
   Font = createObject("java", "java.awt.Font");
   // font name, style and size
   textFont = Font.init( "Arial", Font.ITALIC, javacast("int", 15));
   textLayout = createObject("java", "java.awt.font.TextLayout").init( text, 
textFont, context);        
   textBounds = textLayout.getBounds();
   dimen.width = textBounds.getWidth();
   dimen.height = textBounds.getHeight();
</cfscript>

<cfdump var="#dimen#">


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296573
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to