Andreas L Delmelle wrote:
On Jan 25, 2007, at 05:28, Daniel Noll wrote:
<snip />
However, it seems like almost the whole stack trace could be avoided
if this call cached its results somehow:
org.apache.fop.fonts.Font.getCharWidth(Font.java:231)
(an array of 65536 elements would be enough, but wouldn't be terribly
efficient in terms of memory.)
So the solution may lie in between: make the call once per *used*
character.
It's highly unlikely that a document will contain all 64K characters
anyway...
Whereas that's true (I wasn't planning to call it for all 64k characters
anyway, just as necessary) I was thinking of minimising the lookup time
by looking the character up in an array vs. using a HashMap. But I
guess the initial version can use a HashMap and I'll see what happens
from there. I guess calculating the hash will be trivial at least. :-)
Daniel
--
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia Ph: +61 2 9280 0699
Web: http://nuix.com/ Fax: +61 2 9212 6902
This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]