"Peter B. West" wrote:

I'll try to explain the algorithm a bit for line-building; maybe that
will help to clarify what I meant.

The TextLayoutManager generates a BreakPosition for each possible line
break (not including hyphenation at first). This means breakable spaces
or other possible line end characters like hard hyphens (maybe some
UserAgent list of what constitutes a reasonable linebreak??). The parent
of the TextLM is either an InlineLM or a LineLM. If it's an InlineLM, it
just "wraps" the BreakPosition from the Text by adding any extra space
at the inline level (space-start, space-end, padding...). At the LineLM
level, the manager knows how much space it has available for the
LineArea. It looks at each BreakPosition to see if it still fits in that
space. When it sees one that doesn't fit (ie, the BreakPosition is
beyond the end of its available inline-progression-dimension), it will
then go into hyphenation mode to try to find a break between the
previous BP (which still fit) and the new one. This is where it may
decide on various options, such as more or less stretch in the
white-space, vs hyphens in succeeding lines vs keeps etc.

At the block level, the analogous logic is in the Flow LayoutManager. It
will look at various BreakPositions which express how many Lines or
other block-stacked Areas can fit in the current Flow Area. It makes its
decision based on keep conditions and white-space stretch.

Regards,
Karen

> [EMAIL PROTECTED] wrote:
> 
> >The other thing I've worked on is in the actual LayoutManager logic.
> >I've got this concept of a "BreakPosition" and have some code written at
> >the inline level (text, inline, line). The idea is that instead of an LM
> >calling generateAreas on its child LM, it repeatedly calls
> >"getNextBreakPosition". It then uses the returned BreakPosition
> >information to decide on the best break. Only then does it ask the child
> >LM to actually make the Areas necessary to break at the point.
> >
> Karen,
> 
> I like the idea of BreakPosition being constantly updated (see my notes
> on co-routines).  What do you mean by "decide on the best break"?  What
> sort of things do you see going into that decision that cannot, in
> essence, be decided by the child?  Are you thinking about the resolution
> of ambiguous situations which require knowledge of partial results from
> a number of parallel area subtrees?
> 
> Peter
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to