Link rect and word wrapping.

Michael A. Borisov mic at i-house.ru
Mon Aug 23 11:21:55 BST 2004


Tobias Anton wrote:

>On Montag, 19. Juli 2004 08:37, Michael A. Borisov wrote:
>  
>
>>Hi All,
>>
>>Is it possible to get real link rect(s) with word wrapping
>>consideration? I mean the following thing.
>>
>><div>
>>Some text. Link begin
>>link end. Some text.
>></div>
>>
>>In this case the link's rect will be the rect of div. Is it possible to
>>get link rect(s) exactly.
>>    
>>
>
>As Leo said, it could easily be added to the public API.
>
>Evaluating them would really be hard, though. Imagine for example an HTML 
>fragment like:
>
><a href="blah.html">this is a <font size="+1">big</font> link</a>
>
>In the worst case, four rectangles distributed over three lines can form this 
>link's region. Some of them share a baseline, but might have a different 
>height. The solution would possibly be to convert them to a QRegion which 
>then can be transformed by QT into an ordered set of rectangles where all 
>rectangle that share the same baseline also have the same height. This is 
>done basically by splitting every rectangle along each horizontal corner of 
>any other rectangle that is inside the former's vertical range.
>
>Though I wonder what you are planning to do with this bunch of small 
>rectangles beside drawing a link outline around it, which can already be 
>accomplished by setting a value for the CSS :outline-property on your 
>favourite DOM node.
>  
>
Yes, presently I do it this way.  But it is not beautifull. I would like 
to construct an envelope line for this set of rectangles. Or construct 
some beautifull aim that will be positioned much more precisiously than 
when I use getRect method.

With respect,
Michael.

>Cheers
>-- Tobias
>
>
>
>  
>





More information about the kfm-devel mailing list