# Layout managers

# Layout managers in FOP

What do the layout managers do? Most layout is is "automatic" in the sense of being a straightforward stacking operation. Sibling inline-areas, including fo:character areas, are stacked in line-areas in the inline-progression-direction. Sibling block-areas, including line-areas, are stacked in the block-progression-direction.

In the simple cases in which both the available block-progression-dimension and the available inline-progression-dimension are known, this process can be driven bottom-up. Available dimensions trickle down from the top, and the bottom level galleys can determine when their available areas are full and suspend pending the arrival of more areas. Such full notifications bubble back up the tree of active galleys. E.g., if an inline galley fills a line-area of a given inline-p-d and suspends while still within the available block-p-d, the parent block-area galley will simply stack the inline-area and notify the inline galley to continue. If the inline-galley discovers that the next line-area that it would generate will not fit in the the block-p-d, it suspends with a notification to that effect to its parent.

In more complex cases the dimensions may not be fully specified, or decisions about layout may depend on later layout. In all such cases some layout look-ahead is required which can report results back to higher layout levels. The job for a layout manager in these cirucmstances is to evaluate the information flowing back and set parameters for the best fit layout.