by the funtion is a LONG way out of the actual length of the string
rendered in a browser.
e.g.
<cfscript>
font_obj = createobject("java","java.awt.Font").init('Arial',1,8);
font_metrics_obj =
createobject("java","java.awt.Toolkit").getDefaultToolkit().getFontMetri
cs(font_obj);
Pixel_Width = font_metrics_obj.stringWidth('the pixel width is miles
out?');
</cfscript>
<cfoutput>
#Pixel_Width#
<br>
<img src="" width="<cfoutput>#Pixel_Width#</cfoutput>" height="1"
alt="" border="0">
<br>
<div align="left" style="font-family:Arial;font-size:8pt;">the pixel
width is miles out?</div>
</cfoutput>
You'll need a test gif of course.
Still, I'm not sure why, maybe java just renders fonts entirely
differently to browsers. I tried several fonts and many font sizes, none
of them are even close, or did I miss something?
Craig.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

