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: Nathan Strutz [mailto:[EMAIL PROTECTED]
Sent: Monday, August 16, 2004 12:36 PM
To: CF-Talk
Subject: SUSPECT: Re: slow Java call - Determining physical
length of string - Pt 2


I'm not familiar with what exactly your app is doing, nor the
AWT
library, but app caching, yes. Might there be a way to store the
string
width with the string? For instance, if it's called from a
database, add
a field for width, and recalculate on insert and update, not on
select.

Other than that I've got one last idea. What if you calculate
the length
of a word (assuming this is normal user-input text)? For
example, if
"The" will be 23px wide each time, save it and reuse it. It will
be more
calls to the FontObject initially, once per word instead of per
sentence, but will pay off once it caches a couple hundred
words.

Ehh, maybe not the easiest, but perhaps worth a try.

-nathan strutz
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to