Link rect and word wrapping.

Tobias Anton TA at ESC-Electronics.de
Thu Jul 29 10:23:43 BST 2004


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.

Cheers
-- Tobias





More information about the kfm-devel mailing list