Are TextRuns always sorted?

Dirk Mueller mueller at kde.org
Thu Aug 7 20:13:08 CEST 2003


On Don, 07 Aug 2003, Leo Savernik wrote:

> I looked at it, but this works for coordinates. I need it for offsets. I'm 
> using RenderText::findTextSlave which returns the appropriate text slave for 
> an offset into the string data, and I want to optimize it by binary search, 
> that's why I'm asking.

Yeah, well the TextSlaves are sorted visually, which has little to do with 
the string order in the general case. 

you can still do a "fuzzy" binary search but an exact binary search will 
not work. I assume that you're looking into optimising text selection?

I've seen that the safari tree attempted to do something like that but I 
don't know how they made it work yet (or if they simply ignored the bidi 
problems). 


-- 
Dirk


More information about the Khtml-devel mailing list