-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlayout.xml
261 lines (240 loc) · 10.6 KB
/
layout.xml
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
253
254
255
256
257
258
259
260
261
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Trace objects="no" grid="no" gridallocation="no"/>
<Options mainlanguage="English (USA)" ignoreeol="yes" />
<LoadFontfile name="medium" filename="FiraSans-Regular.otf"/>
<LoadFontfile name="regular" filename="firasanscondensed-light.otf"/>
<LoadFontfile name="italic" filename="firasanscondensed-lightitalic.otf"/>
<Pageformat width="302.5mm" height="455mm"/>
<DefineFontfamily name="text" fontsize="8" leading="10">
<Regular fontface="regular"/>
<Bold fontface="medium"/>
</DefineFontfamily>
<DefineFontfamily name="NonsenseNews" fontsize="12" leading="12">
<Regular fontface="medium"/>
<Italic fontface="italic"/>
</DefineFontfamily>
<DefineTextformat name="textindent" indentation="10pt" widow="yes" orphan="yes"/>
<DefineTextformat name="text" widow="yes" orphan="yes"/>
<DefineTextformat name="caption" indentation="0pt"/>
<DefineTextformat name="h1" alignment="leftaligned"/>
<DefineTextformat name="h2" alignment="leftaligned"/>
<SetGrid width="45mm" height="10pt" dx="2.5mm"/>
<Record element="collection">
<SetVariable variable="dy" select="4"/>
<Pagetype name="page" test="true()">
<Margin left="10mm" right="10mm" top="12.7mm" bottom="12.7mm"/>
<ForAll select="article">
<!-- Each article gets its own area
a more general area for the title and images and one area for each column -->
<PositioningArea name="{concat('article',position(),'-complete')}">
<PositioningFrame width="{@width}" height="{@height}" row="{@y + $dy}"
column="{@x}"/>
</PositioningArea>
<PositioningArea name="article{position()}">
<Loop select="@width" variable="i">
<PositioningFrame width="1" height="{@height}" row="{@y + $dy}"
column="{@x + $i - 1 }"/>
</Loop>
</PositioningArea>
</ForAll>
<AtPageCreation>
<PlaceObject column="1" row="1">
<Table stretch="max" fontfamily="NonsenseNews">
<Columns>
<Column width="1*"/>
<Column width="1*"/>
<Column width="1*"/>
</Columns>
<Tr>
<Td align="left">
<Paragraph>
<Value>Page 2</Value>
</Paragraph>
</Td>
<Td align="center">
<Paragraph>
<I>
<Value>Nonsense News</Value>
</I>
</Paragraph>
</Td>
<Td align="right">
<Paragraph>
<Value>Wednesday, May 35. 2016</Value>
</Paragraph>
</Td>
</Tr>
<Tablerule/>
</Table>
</PlaceObject>
</AtPageCreation>
</Pagetype>
<ProcessNode select="advertisement"/>
<ProcessNode select="article"/>
</Record>
<Record element="advertisement">
<PlaceObject row="{@y + $dy}" column="{@x}">
<Image file="{@img}" width="{@width}" height="{@height}"/>
</PlaceObject>
</Record>
<Record element="article">
<Message select="concat('Article name: ',string(title))"/>
<SetVariable variable="area" select="concat('article',position())"/>
<SetVariable variable="wholearea" select="concat('article',position(),'-complete')"/>
<Switch>
<Case test="@width = 1">
<!-- Small -->
<DefineFontfamily name="h1" fontsize="18" leading="18">
<Regular fontface="medium"/>
</DefineFontfamily>
</Case>
<Case test="@width = 2 and @height < 20">
<DefineFontfamily name="h1" fontsize="22" leading="26">
<Regular fontface="medium"/>
</DefineFontfamily>
</Case>
<Case test="@width = 2">
<DefineFontfamily name="h1" fontsize="26" leading="26">
<Regular fontface="medium"/>
</DefineFontfamily>
<DefineFontfamily name="h2" fontsize="13" leading="13">
<Regular fontface="regular"/>
</DefineFontfamily>
</Case>
<Case test="@width = 3 and @height < 30">
<DefineFontfamily name="h1" fontsize="24" leading="24">
<Regular fontface="medium"/>
</DefineFontfamily>
</Case>
<Case test="@width = 3">
<DefineFontfamily name="h1" fontsize="30" leading="30">
<Regular fontface="medium"/>
</DefineFontfamily>
<DefineFontfamily name="h2" fontsize="15" leading="15">
<Regular fontface="regular"/>
</DefineFontfamily>
</Case>
<Case test="@width = 4">
<DefineFontfamily name="h1" fontsize="38" leading="38">
<Regular fontface="medium"/>
</DefineFontfamily>
<DefineFontfamily name="h2" fontsize="16" leading="22">
<Regular fontface="regular"/>
</DefineFontfamily>
</Case>
<Otherwise>
<DefineFontfamily name="h1" fontsize="43" leading="43">
<Regular fontface="medium"/>
</DefineFontfamily>
<DefineFontfamily name="h2" fontsize="16" leading="20">
<Regular fontface="regular"/>
</DefineFontfamily>
</Otherwise>
</Switch>
<SetVariable variable="articleheight" select="@height"/>
<Switch>
<Case test="@type = 'info'">
<PlaceObject row="1" column="1" area="{$wholearea}">
<Image width="{@width}" file="{@head}"/>
</PlaceObject>
</Case>
</Switch>
<Switch>
<Case test="string(title) != ''">
<PlaceObject row="1" column="1" area="{$wholearea}">
<Textblock width="{@width}">
<Paragraph fontfamily="h1" textformat="h1">
<Value select="string(title)"/>
</Paragraph>
</Textblock>
</PlaceObject>
</Case>
</Switch>
<Switch>
<Case test="string(subtitle) != ''">
<PlaceObject column="1" area="{$wholearea}">
<Textblock width="{@width}">
<Paragraph fontfamily="h2" textformat="h2">
<Value select="string(subtitle)"/>
</Paragraph>
</Textblock>
</PlaceObject>
</Case>
</Switch>
<NextRow row="{sd:current-row($wholearea)}" area="{$area}"/>
<SetVariable variable="firstrow" select="sd:current-row($area)"/>
<ProcessNode select="image"/>
<Switch>
<Case test="not(empty(text))">
<Output area="{$area}" allocate="yes">
<Text>
<ForAll select="text/p">
<Paragraph fontfamily="text" textformat="{if (position() = 1) then 'text' else 'textindent'}">
<Value select="."/>
</Paragraph>
</ForAll>
</Text>
</Output>
</Case>
</Switch>
</Record>
<Record element="image">
<Group name="img">
<Contents>
<Switch>
<Case test="@row != 'top'">
<PlaceObject column="1">
<Box width="{@width}" height="1" backgroundcolor="white"/>
</PlaceObject>
</Case>
</Switch>
<PlaceObject frame="solid" column="1">
<Switch>
<Case test="empty(@height)">
<Image file="{@filename}" width="{@width}"/>
</Case>
<Otherwise>
<Image file="{@filename}" width="{@width}" height="{@height}" clip="yes"
/>
</Otherwise>
</Switch>
</PlaceObject>
<Switch>
<Case test="not(empty(@caption))">
<PlaceObject column="1">
<Textblock width="{@width}" textformat="caption">
<Paragraph>
<B>
<Value select="@caption"/>
</B>
</Paragraph>
</Textblock>
</PlaceObject>
</Case>
</Switch>
<Switch>
<Case test="@row != 'bottom'">
<PlaceObject column="1">
<Box width="{@width}" height="1" backgroundcolor="white"/>
</PlaceObject>
</Case>
</Switch>
</Contents>
</Group>
<Switch>
<Case test="@row = 'bottom'">
<PlaceObject column="{@column}" row="{$articleheight}" keepposition="yes"
groupname="img" vreference="bottom" valign="bottom" area="{$wholearea}"/>
</Case>
<Case test="@row = 'top'">
<PlaceObject column="{@column}" row="{$firstrow}" keepposition="yes" groupname="img"
area="{$wholearea}"/>
</Case>
<Otherwise>
<PlaceObject column="{@column}" row="{@row + $firstrow}" keepposition="yes"
groupname="img" area="{$wholearea}"/>
</Otherwise>
</Switch>
</Record>
</Layout>