aboutsummaryrefslogtreecommitdiffstats
path: root/docs/examples/fo/textdeko.fo
blob: af9f0dfb072cac30a53deb6d5bbf4192f5ce7544 (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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?xml version="1.0" encoding="utf-8"?>

<!-- simple example for text-decoration -->

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

  <fo:layout-master-set>

    <!-- layout for the first page -->
    <fo:simple-page-master master-name="first"
                  page-height="29.7cm" 
                  page-width="21cm"
                  margin-top="1cm" 
                  margin-bottom="2cm" 
                  margin-left="2.5cm" 
                  margin-right="2.5cm">
      <fo:region-body margin-top="3cm"/>
      <fo:region-before extent="3cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>

    <!-- layout for the other pages -->
    <fo:simple-page-master master-name="rest"
                  page-height="29.7cm" 
                  page-width="21cm"
                  margin-top="1cm" 
                  margin-bottom="2cm" 
                  margin-left="2.5cm" 
                  margin-right="2.5cm">
      <fo:region-body margin-top="2.5cm"/>
      <fo:region-before extent="2.5cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>

<fo:page-sequence-master master-name="basicPSM" >
	<fo:repeatable-page-master-alternatives>
		<fo:conditional-page-master-reference master-reference="first"
			page-position="first" />
		<fo:conditional-page-master-reference master-reference="rest"
			page-position="rest" />
		<!-- recommended fallback procedure -->
		<fo:conditional-page-master-reference master-reference="rest" />
	</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>

  </fo:layout-master-set>
  <!-- end: defines page layout -->

  <!-- actual layout -->
  <fo:page-sequence master-reference="basicPSM">

    <fo:flow flow-name="xsl-region-body">

      <fo:block font-size="18pt" font-family="sans-serif" line-height="24pt" space-after.optimum="15pt"
            background-color="blue" color="white" text-align="center" padding-top="3pt">
      Simple example for text-decoration
      </fo:block>

      <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="10pt">
      The "text-decoration"-property describes decorations that are added to the text of an element.
      If the property is specified for a block-level element, it should affect all inline-level descendants
      of the element (does not work yet!).
      If it is specified for (or affects) an inline-level
      element, it affects all boxes generated by the element.
      </fo:block>

      <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" space-after.optimum="13pt">
      Example: <fo:inline text-decoration="underline">underline</fo:inline>
      </fo:block>

      <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" space-after.optimum="10pt">
      <fo:inline font-family="monospace"><![CDATA[<fo:inline text-decoration="underline">underline</fo:inline>]]></fo:inline>
      </fo:block>

      <fo:block font-size="12pt" 
                font-family="serif" 
                line-height="15pt"
                space-after.optimum="10pt"
                text-align="start">
        This is simple test of the text-decoration<fo:inline text-decoration="underline">underline</fo:inline>.
      </fo:block>
      <fo:block font-size="22pt" 
                font-family="sans-serif" 
                line-height="15pt"
                space-after.optimum="10pt"
                text-align="start">
        This is simple test with a <fo:inline text-decoration="underline">bigger</fo:inline> font-size.
      </fo:block>
      <fo:block font-size="12pt" 
                font-family="monospace" 
                line-height="15pt"
                space-after.optimum="20pt"
                text-align="start">
        This is simple test with a <fo:inline text-decoration="underline">monospaced</fo:inline> font.

      </fo:block>

      <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="3pt">
      The following text decorations are defined in the CR:
      </fo:block>

      <fo:list-block space-after.optimum="13pt">

        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>
              <fo:inline text-decoration="none">none</fo:inline>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>

        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>
              <fo:inline text-decoration="underline">underline</fo:inline>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>

        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>
              <fo:inline text-decoration="overline">overline</fo:inline>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>

        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>
              <fo:inline text-decoration="line-through">line-through</fo:inline>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>

        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>
              <fo:inline text-decoration="blink">blink</fo:inline>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>

        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>
              <fo:inline text-decoration="no-underline">no-underline</fo:inline>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>

        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>
              <fo:inline text-decoration="no-overline">no-overline</fo:inline>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>

        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>
              <fo:inline text-decoration="no-line-through">no-line-through</fo:inline>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>

        <fo:list-item>
          <fo:list-item-label end-indent="label-end()">
            <fo:block>&#x2022;</fo:block>
          </fo:list-item-label>
          <fo:list-item-body start-indent="body-start()">
            <fo:block>
              <fo:inline text-decoration="no-blink">no-blink</fo:inline>
            </fo:block>
          </fo:list-item-body>
        </fo:list-item>

      </fo:list-block>

      <fo:block font-size="12pt" space-after.optimum="3pt">
      <fo:inline text-decoration="underline overline">Combination</fo:inline> of property
      values should also be possible, but does not work in FOP at the moment.
      </fo:block>

      <fo:block font-size="12pt" space-after.optimum="13pt">
      <fo:inline font-family="monospace"><![CDATA[<fo:inline text-decoration="underline overline">
      Combination</fo:inline>]]></fo:inline>
      </fo:block>


      <fo:block space-after.optimum="13pt">
        And now <fo:inline text-decoration="underline">more than a word...</fo:inline>
      </fo:block>

      <fo:block space-after.optimum="13pt" font-size="14pt" >
      <fo:inline text-decoration="underline">
      This is a whole block wrapped in fo:inline with the property text-decoration="underline".
      Some more Text to get at least two lines.
      </fo:inline>
      </fo:block>

      <fo:block font-size="22pt" 
                font-family="sans-serif" 
                line-height="22pt"
                space-after.optimum="10pt"
                text-align="start">
        This is simple test with a <fo:inline text-decoration="overline">bigger font-size</fo:inline>.
      </fo:block>
      <fo:block font-size="15pt" 
                font-family="monospace" 
                line-height="15pt"
                space-after.optimum="10pt"
                text-align="start">
        This is simple test with a <fo:inline text-decoration="line-through">monospaced font</fo:inline>.
      </fo:block>

      <fo:block font-size="15pt" 
                line-height="15pt"
                space-after.optimum="10pt"
                text-align="start">
        What about underlining of whitespace only<fo:inline text-decoration="underline"> </fo:inline>?
      </fo:block>


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