Figure 3: Possible page layout in extended XSL-FO. Figure 6: Simple arbitrary shapes. In the original XSL-FO model only four regions can be described (roughly corresponding to the header, footer anc both margins of a page) and all that is not included in one of these regions comprises the body of the page. A simi- lar effect can be immediately achieved through the use o! four shapes. Figure [6]shows three page models that coulc be obtained through the use of arbitrary shapes. The first model imitates the standard XSL-FO model, with only fout rectangular regions and the text body being defined as ev- erything that is not included in those regions. In the sec: ond page there are two non-rectangular margins and the remaining area forming the body of the page is shaped as a Z. In the third page a non-rectangular header frames twc other shapes that can be used as text columns. In this case the true body of the page is the remaining area around the columns, and will not have any content. Figure 9: Overlapping regions in XSL-FO 1.0 denoted in dashed areas. Figure 8: Two different shapes composed by a different number of primitives. On the other hand, an unlimited number of possibly over- lapping page regions entails that an unlimited number of re- gion overlapping combinations may take place. Moreover, the possibly non-rectangular shape of the overlapping areas implies that when such an overlapping occurs, the clipping of areas must be performed through constructive area ge- ometry instead of simply adjusting the dimensions of a rect- angle, as is currently done in XSL-FO. We therefore propose two additional attributes for the arbitrary region element, which should enable the proper specification of overlapping behavior for non-rectangular areas. These attributes are described in Sections B.3.4] and [3.3.5] Figure [10]contains an example composed of three regions placed on a page according to their layer. The numbet within each region represents the layer associated to it, but from that figure it is not clear how the three regions shoulc interact in the overlapping areas. Figure [1 1]shows two dif. ferent ways of resolving the same situation. The main dif- ference is that the document designer could wish that over- lapped regions should recede and render their content ir the remaining visible area as in[[1{a) or that their content is to be overlapped as in fi{b). A combination of inter. actions could also be desirable, with the right vertical ba1 receding and the left one being overlapped. To handle such situations, a second attribute is associated to a region, in- forming whether that region will recede or not. Figure 11: Two possible interactions between overlapping regions. In (a), the overlapped regions recede and text is not rendered in the overlapped areas. In (b) there is true overlapping. Figure 10: Three different shapes with overlapping regions. Figure 12: Background in Shape 2 of Figure B] Figure 13: A Bounding Box indent, end-indent ...), generate a clipping rectangle de- rived from its bounding box and resized accordingly, which is then used to clip the resulting arbitrary area. An exam- ple of such operation is the clipping of an arbitrary region which exceeds the defined page margins (Figure [14). Moreover allocating new block areas throughout the lay- out of a page sequence also uses a similar approach. Namely, the allocation rectangle used to specify the available space for the line building algorithm is used as a clipping box and intersected with the parent arbitrary area (Figure [15). One of the main new capabilities included in the proto- type is the possibility to define an arbitrarily-shaped area for the body region within a page layout. This allows flow content to be laid out within this arbitrary shape across multiple pages. The shapes associated to the body region are currently specified using SVG [16]. The specified SVG is read by the parser contained in FOP, and the outline of the resulting picture defines the boundaries for the arbi- trary area. The prototype uses the latest Batik library to parse such SVG and convert it into Java2D objects, which are then used to derive the area shape. For example, an XSL-FO definition within a simple page master defining an yin-yang shaped area on top of rectangular area would gen- erate pages looking like Figure [I7] Figure 17: Content laid out over yin-yang symbol. Figure 18: AS-FOP versus Apache FOP.