Using Exceed Space

A common problem is that the material selected for layout is not fitting into the current container. The DC's regular approach to solving such a conflict is doing backtracking, searching over line and page breaks, and trying out design patterns-in other words, looking for an alternative layout.

Unfortunately, even extensive search for a valid alternative layout may fail. And there are situations, where the designer is completely aware of the fact that the search will fail-then the search could be completely skipped. Anyway, in these cases, the DC's regular approach will provide no result at all, apparently a bad result.

An answer to these problems is the use of scrolling. The DC's regular approach aims at a result without scrolling, thus a means for enabling scrolling is required.

Such a means is the so-called exceed space, this is space provided by a container in addition to its regular bounds. Thus objects may exceed the container's bounds, what results in scrollbars in the frame where the object is located.

Example

Assumed we want that lines may be exceeded by a certain amount. This can be specified as follows.

design line()
{
	pattern first:
		wExceed = 100;
		constraints = hOrdering;
	{
	}
}

Here we enable exceeding the horizontal bounds by 100 pixels. This additional space is always used assumed that there is enough material available for filling the line, thus scrollbars will appear in the frame ancestor.

However, in many cases one is not interested in this unlimited appearance of scrollbars. In the contrary, one is interested in the DC's regular optimization that avoids scrollbars, and wants to add scrollbars only in the worst case.

To express such limitations of the application of exceed space, an exceed condition may be specified. It restricts the exceed of the container bounds to the cases, where the condition is fulfilled.

design line()
{
	pattern first:
		exceedCondition = getNumChildren(this())==1;
		wExceed = 100;
		constraints = hOrdering;
	{
	}
}

In our example, only extraordinary wide objects should be allowed to exceed the container bounds. To capture this condition, we restrict using the exceed space to lines that carry only a single object.

Assumed the line is used as a subcontainer of a paragraph, the system first tries to add a new object at the end of the line. If it fails there, a new line is created where only the new object is placed-and here it may exceed the container bounds. Thus the remaining paragraph is optimized, but not the line with the crucial object.