Render of Thai text with and without mouse selection

Leo Savernik l.savernik at aon.at
Mon Dec 27 19:21:15 GMT 2004


Am Montag, 27. Dezember 2004 17:26 schrieb Otto Pattara:
> > The only thing I can perceive from the small example is that the
> > text moves around slightly while selecting it. This is the bug I'm
> > talking about.
>
> Yes, then I think we are talking about the same thing.
>
> Would you mind sharing me some more information about this bug or
> pointing to some URLs or source code? Just when you have time...

Here you go:

Painting the selection:
http://lxr.kde.org/ident?i=paintSelection

Painting the text (and the selection in a different pass):
RenderText::paint
http://lxr.kde.org/source/kdelibs/khtml/rendering/render_text.cpp#L908

The problem is the fact that certain scripts combine adjacent characters when 
drawn as a single text run. However, the selection may break the combining at 
any point, thus producing two separate (and normally different looking) 
characters, one in front of, and one after the selection boundary.

The proper solution would be to draw the full run, and clip it between the 
combined characters (this will keep the characters from being drawn in their 
separated form). However, there's no public API in Qt to retrieve the exact 
point of clipping (or is there, Lars?).

Otto, feel free to work on the problem if you like. If you manage to achieve a 
working result, I'd like to see the patches.

mfg
 Leo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20041227/a274a3b0/attachment.sig>


More information about the kfm-devel mailing list