RE: SUSPECT: Re: slow Java call - Determining physical length of string - Pt 2

2004-08-16 Thread Dirk Sieber
Well, we'd thought about storing values - but that's basically the same as the original idea of storing the width of each individual character, and I think it would just become very unwieldy to manage.  It's a possibility though, and I thank you for the idea! -Original Message- From: Nat

RE: SUSPECT: Re: slow Java call - Determining physical length of string - Pt 2

2004-08-16 Thread Dirk Sieber
I would definitely agree that the issue appears to be the instantiation time - my problem here is that this is basically the first time I've dealt with objects and/or Java in relation to CF.  So... how do I go about reusing the FontMetrics object once I've created it?  You'll have to excuse my igno

Re: SUSPECT: Re: slow Java call - Determining physical length of string - Pt 2

2004-08-16 Thread Peter Farrell
I wrote a quick and dirty CFC of the fontmetrics stuff.  I can do 100 calls including the dynamic generation of strings to send to fontmetrics at around 300-330 ms total for the 100 calls to the method.  FYI, this also includes dynamic string generation (i.e. each call doesn't send in the same stri

RE: SUSPECT: RE: slow Java call - Determining physical length of string - Pt 2

2004-08-18 Thread Dirk Sieber
We're starting to run into that as well...some of the numbers seem to be quite off - just when we thought we had a solution.  Anyone have any other ideas on how we can accomplish this?  This doesn't have to be cross-platform - any way to call a native Windows function to get the correct size? Th

RE: SUSPECT: RE: slow Java call - Determining physical length of string - Pt 2

2004-08-18 Thread Micha Schopman
Why don't you use _javascript_ to return the width? Or is it supposed to run serverside?
function stringMetrics(str){
var tmp = document.createElement("SPAN");
tmp.appendChild(document.createTextNode(str));
tmp.style.display = 'none';

Re: SUSPECT: Re: slow Java call - Determining physical length of string - Pt 2

2004-08-19 Thread Peter Farrell
I'm not a java programmer, but I think you need to set the java.awt.font.FontRenderContext: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/font/FontRenderContext.html My tests shows that the returned value from java is closer to 150 dpi not screen resolution. .pjf [Todays Threads] [This Mess