I've thought about this some more. While this approach might work for
unbroken list-items, it will not suffice as soon as a list item is
broken over more than one page. In such a case the baseline alignment
has to be calculated for each break possibility and somehow woven into
the block-progression element lists (probably using the ListItemPosition).
The same would then apply later to the tables, too, where the whole
thing might even be a bit more complicated. In this light, my first idea
is a hack and therefore a bad idea. It looks like I can't get this done
as easily as I thought at first. Additional thoughts still welcome.

On 06.09.2010 17:51:59 Jeremias Maerki wrote:
> Someone asked me how much work it would be to implement relative-align
> on lists. I wonder if the following approach will work:
> 
> ListItemLayoutManager first gets the element list for the label, then
> for the body. Each time a Layout context is passed it. The
> LineLayoutManager could set the baseline information for the first line
> as long as no other down-stream layout context has set that information.
> Then that information could be passed up until the ListItemLayoutManager
> which could then insert a dummy KnuthBox for a space used for alignment.
> The ListItemContentLayoutManager could then handle the necessary
> additional space. Probably something similar for tables. A little
> awkward but that should work.
> 
> Is that feasible or does anyone have a better idea?
> 
> Thanks,
> Jeremias Maerki
> 




Jeremias Maerki

Reply via email to