xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas L Delmelle <a_l.delme...@pandora.be>
Subject Re: Initial soft hyphen support
Date Tue, 16 Jan 2007 18:10:54 GMT
On Jan 15, 2007, at 22:20, Andreas L Delmelle wrote:

> <snip />

> Not really sure what would be most efficient:
> - a void method appending to a parameter StringBuffer
> - a method returning a copy of the char[] from index to index...
>
> Seen that every String ultimately has a backing char[](*) anyway,  
> I'd say that we can safely return the copy, and remove the overhead of
>
> StringBuffer.append(new String(char[])).toString().toCharArray()

Looked a bit deeper, and there is apparently a good reason to use a  
StringBuffer: the char[] from one FOText might need to be appended to  
that of a previous one (see TextLM.findHyphenationPoints()).

I guess it would be a bad idea to replace this with arrays, since  
they're not so straightforward to concatenate (requires copying into  
a new array).

Too bad we're still targeting 1.3, else we might consider switching  
to a java.nio.CharBuffer...


Cheers,

Andreas


Mime
View raw message