aboutsummaryrefslogtreecommitdiffstats
path: root/docs/examples/fo/blockcontainer.fo
blob: c468218879352a2c621656f28e6d34b98c3c1f77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
<fo:layout-master-set>
  <fo:simple-page-master master-name="one">
    <fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="50pt" margin-right="50pt" />
  </fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="one">
<fo:flow flow-name="xsl-region-body">
      <fo:block text-align="center" font-size="16pt" font-weight="bold">
        Block Containers
      </fo:block>

      <fo:block>
        The fo:block-container object can be used to create an area with
        a different writing mode or a different reference orientation.
        The areas can be part of the flow or absolutely positioned.
      </fo:block>

      <fo:block>
        This is a normal block container within the flow layout.
        <fo:block-container>
          <fo:block>
              BC:A
          </fo:block>
        </fo:block-container>
      </fo:block>

      <fo:block>
        This block container has a different reference orientation.
        <fo:block-container reference-orientation="90" inline-progression-dimension="100pt">
          <fo:block>
              BC:B
          </fo:block>
          <fo:block>
              The areas are stacked normally but the orientation of the
              area is rotated 90 degrees anti-clockwise.
          </fo:block>
          <fo:block>
              The blocks continue until exhausted as the layout
              height of this container is fixed in the parent
              block progression dimension. The clipping of the result
              is determined by the overflow property. The block
              progression dimension of this container is effectively
              infinite.
          </fo:block>
        </fo:block-container>
      </fo:block>

      <fo:block>
        This block container has a different reference orientation.
        <fo:block-container reference-orientation="270" inline-progression-dimension="100pt">
          <fo:block>
              BC:B II
          </fo:block>
          <fo:block>
              The areas are stacked normally but the orientation of the
              area is rotated 90 degrees clockwise.
          </fo:block>
          <fo:block>
              The blocks continue until exhausted as the layout
              height of this container is fixed in the parent
              block progression dimension. The clipping of the result
              is determined by the overflow property.
          </fo:block>
        </fo:block-container>
      </fo:block>

      <fo:block>
        This block container has a different reference orientation.
        <fo:block-container reference-orientation="180" inline-progression-dimension="100pt">
          <fo:block>
              BC:B III
          </fo:block> 
          <fo:block>
              The areas are stacked normally but the orientation of the
              area is rotated 180 degrees clockwise.
          </fo:block>
          <fo:block>
              This block container behaves as part of the flow except
              the contents are drawn rotated within the viewport by
              180 degrees.
          </fo:block>
        </fo:block-container>
      </fo:block> 

      <fo:block>
        different writing mode
        <fo:block-container writing-mode="rl">
          <fo:block>
              BC:C
          </fo:block>
          <fo:block>
            The areas in this block are stacked according to the rl (tb)
            writing mode.
          </fo:block>
        </fo:block-container>
      </fo:block>

      <fo:block>
        The next block-container has an absolute position. It does
        not effect the flow layout of other blocks.
        <fo:block-container absolute-position="absolute"
              left="20pt" top="400pt" right="220pt" bottom="550pt">
          <fo:block>
              BC:D
          </fo:block>
          <fo:block>
            This is a normal block that is confined to the
            block container.
          </fo:block>
        </fo:block-container>
      </fo:block>

      <fo:block>
        The next block-container has an absolute position. It does
        not effect the flow layout of other blocks. This time with
        the reference-orientation set.
        <fo:block-container reference-orientation="270" absolute-position="absolute"
              left="270pt" top="400pt" right="370pt" bottom="500pt">
          <fo:block>
              BC:E
          </fo:block>
          <fo:block>
            This is a normal block that is confined to the
            block container.
          </fo:block>
        </fo:block-container>
      </fo:block>

      <fo:block break-after="page">
        End of page.
      </fo:block>

      <fo:block>
        The next block-container tests the clipping.
        <fo:block-container reference-orientation="180" absolute-position="absolute"
              left="100pt" top="550pt" right="200pt" bottom="700pt"
              overflow="hidden">
          <fo:block>
              BC:F
          </fo:block>
          <fo:block>
            This is a normal block that is confined to the
            block container. It also has contents that are
            larger than the block-container so that this text
            will be clipped to the viewport.
          </fo:block>
        </fo:block-container>
      </fo:block>

      <fo:block>
        The next block-container tests error-if-overflow.
        <fo:block-container reference-orientation="90" absolute-position="absolute"
              left="220pt" top="600pt" right="320pt" bottom="700pt"
              overflow="error-if-overflow">
          <fo:block>
              BC:G
          </fo:block>
          <fo:block>
            This is a normal block that is confined to the
            block container. It also has contents that are
            larger than the block-container so that this text
            will be clipped to the viewport.
          </fo:block>
        </fo:block-container>
      </fo:block>

    </fo:flow>
  </fo:page-sequence>
</fo:root>