Debian Codegraph @

samples/tests/spec/paints/patternPreserveAspectRatioA.svg

raw
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
3 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
4
5 <!--
6
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
13
14 http://www.apache.org/licenses/LICENSE-2.0
15
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
21
22 -->
23 <!-- ========================================================================= -->
24 <!-- -->
25 <!-- @author [email protected] -->
26 <!-- @version $Id$ -->
27 <!-- ========================================================================= -->
28
29 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
30
31 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500">
32 <title>Pattern Region Test, B</title>
33
34 <text x="225" y="30" class="title">
35 patterns, preserveAspectRatio
36 </text>
37
38 <!-- ============================================================= -->
39 <!-- Test content -->
40 <!-- ============================================================= -->
41 <g id="testContent" >
42 <defs>
43
44 <g id="patternColumn">
45 <circle cx=".5" cy=".5" r=".5" />
46 <rect x="0" y="1" width="1" height="1" />
47 <path d="M 0 3 l 1 0 l -0.5 -1 z" />
48 </g>
49
50 <!-- Pattern content is 24 by 24 -->
51 <g id="patternContent" transform="scale(8, 8)" >
52 <rect x="0" y="0" width="3" height="3" fill="black" />
53 <use xlink:href="#patternColumn" fill="crimson" />
54 <use xlink:href="#patternColumn" x="1" fill="gold" />
55 <use xlink:href="#patternColumn" x="2" fill="orange" />
56 </g>
57
58 <rect id="testShape" transform="translate(45, 5)" width="90" height="30" />
59
60 <!-- ============================================== -->
61 <!-- For all the following patterns: -->
62 <!-- -->
63 <!-- patternUnits : userSpaceOnUse -->
64 <!-- patternContentUnits : default (userSpaceOnUse) -->
65 <!-- patternTransform: default (identity) -->
66 <!-- preserveAspectRatio: variable for each test -->
67 <!-- overflow : default (hidden) -->
68 <!-- -->
69 <!-- ============================================== -->
70
71 <!-- ============ -->
72 <!-- meetXxxxYyyy -->
73 <!-- ============ -->
74
75 <pattern id="meetXminYmin"
76 patternUnits="userSpaceOnUse"
77 x="0" y="0"
78 width="32" height="16"
79 viewBox="0 0 24 24"
80 preserveAspectRatio="xMinYMin meet">
81 <use xlink:href="#patternContent" />
82 </pattern>
83
84 <pattern id="meetXminYmid"
85 patternUnits="userSpaceOnUse"
86 x="0" y="0"
87 width="32" height="16"
88 viewBox="0 0 24 24"
89 preserveAspectRatio="xMinYMid meet">
90 <use xlink:href="#patternContent" />
91 </pattern>
92
93 <pattern id="meetXminYmax"
94 patternUnits="userSpaceOnUse"
95 x="0" y="0"
96 width="32" height="16"
97 viewBox="0 0 24 24"
98 preserveAspectRatio="xMinYMax meet">
99 <use xlink:href="#patternContent" />
100 </pattern>
101
102 <pattern id="meetXmidYmin"
103 patternUnits="userSpaceOnUse"
104 x="0" y="0"
105 width="32" height="16"
106 viewBox="0 0 24 24"
107 preserveAspectRatio="xMidYMin meet">
108 <use xlink:href="#patternContent" />
109 </pattern>
110
111 <pattern id="meetXmidYmid"
112 patternUnits="userSpaceOnUse"
113 x="0" y="0"
114 width="32" height="16"
115 viewBox="0 0 24 24"
116 preserveAspectRatio="xMidYMid meet">
117 <use xlink:href="#patternContent" />
118 </pattern>
119
120 <pattern id="meetXmidYmax"
121 patternUnits="userSpaceOnUse"
122 x="0" y="0"
123 width="32" height="16"
124 viewBox="0 0 24 24"
125 preserveAspectRatio="xMidYMax meet">
126 <use xlink:href="#patternContent" />
127 </pattern>
128
129 <pattern id="meetXmaxYmin"
130 patternUnits="userSpaceOnUse"
131 x="0" y="0"
132 width="32" height="16"
133 viewBox="0 0 24 24"
134 preserveAspectRatio="xMaxYMin meet">
135 <use xlink:href="#patternContent" />
136 </pattern>
137
138 <pattern id="meetXmaxYmid"
139 patternUnits="userSpaceOnUse"
140 x="0" y="0"
141 width="32" height="16"
142 viewBox="0 0 24 24"
143 preserveAspectRatio="xMaxYMid meet">
144 <use xlink:href="#patternContent" />
145 </pattern>
146
147 <pattern id="meetXmaxYmax"
148 patternUnits="userSpaceOnUse"
149 x="0" y="0"
150 width="32" height="16"
151 viewBox="0 0 24 24"
152 preserveAspectRatio="xMaxYMax meet">
153 <use xlink:href="#patternContent" />
154 </pattern>
155
156
157 <!-- ============ -->
158 <!-- sliceXxxxYyyy -->
159 <!-- ============ -->
160
161 <pattern id="sliceXminYmin"
162 patternUnits="userSpaceOnUse"
163 x="0" y="0"
164 width="32" height="16"
165 viewBox="0 0 24 24"
166 preserveAspectRatio="xMinYMin slice">
167 <use xlink:href="#patternContent" />
168 </pattern>
169
170 <pattern id="sliceXminYmid"
171 patternUnits="userSpaceOnUse"
172 x="0" y="0"
173 width="32" height="16"
174 viewBox="0 0 24 24"
175 preserveAspectRatio="xMinYMid slice">
176 <use xlink:href="#patternContent" />
177 </pattern>
178
179 <pattern id="sliceXminYmax"
180 patternUnits="userSpaceOnUse"
181 x="0" y="0"
182 width="32" height="16"
183 viewBox="0 0 24 24"
184 preserveAspectRatio="xMinYMax slice">
185 <use xlink:href="#patternContent" />
186 </pattern>
187
188 <pattern id="sliceXmidYmin"
189 patternUnits="userSpaceOnUse"
190 x="0" y="0"
191 width="32" height="16"
192 viewBox="0 0 24 24"
193 preserveAspectRatio="xMidYMin slice">
194 <use xlink:href="#patternContent" />
195 </pattern>
196
197 <pattern id="sliceXmidYmid"
198 patternUnits="userSpaceOnUse"
199 x="0" y="0"
200 width="32" height="16"
201 viewBox="0 0 24 24"
202 preserveAspectRatio="xMidYMid slice">
203 <use xlink:href="#patternContent" />
204 </pattern>
205
206 <pattern id="sliceXmidYmax"
207 patternUnits="userSpaceOnUse"
208 x="0" y="0"
209 width="32" height="16"
210 viewBox="0 0 24 24"
211 preserveAspectRatio="xMidYMax slice">
212 <use xlink:href="#patternContent" />
213 </pattern>
214
215 <pattern id="sliceXmaxYmin"
216 patternUnits="userSpaceOnUse"
217 x="0" y="0"
218 width="32" height="16"
219 viewBox="0 0 24 24"
220 preserveAspectRatio="xMaxYMin slice">
221 <use xlink:href="#patternContent" />
222 </pattern>
223
224 <pattern id="sliceXmaxYmid"
225 patternUnits="userSpaceOnUse"
226 x="0" y="0"
227 width="32" height="16"
228 viewBox="0 0 24 24"
229 preserveAspectRatio="xMaxYMid slice">
230 <use xlink:href="#patternContent" />
231 </pattern>
232
233 <pattern id="sliceXmaxYmax"
234 patternUnits="userSpaceOnUse"
235 x="0" y="0"
236 width="32" height="16"
237 viewBox="0 0 24 24"
238 preserveAspectRatio="xMaxYMax slice">
239 <use xlink:href="#patternContent" />
240 </pattern>
241
242 <!-- ============ -->
243 <!-- noneXxxxYyyy -->
244 <!-- ============ -->
245
246 <pattern id="noneXminYmin"
247 patternUnits="userSpaceOnUse"
248 x="0" y="0"
249 width="32" height="16"
250 viewBox="0 0 24 24"
251 preserveAspectRatio="xMinYMin">
252 <use xlink:href="#patternContent" />
253 </pattern>
254
255 <pattern id="noneXminYmid"
256 patternUnits="userSpaceOnUse"
257 x="0" y="0"
258 width="32" height="16"
259 viewBox="0 0 24 24"
260 preserveAspectRatio="xMinYMid">
261 <use xlink:href="#patternContent" />
262 </pattern>
263
264 <pattern id="noneXminYmax"
265 patternUnits="userSpaceOnUse"
266 x="0" y="0"
267 width="32" height="16"
268 viewBox="0 0 24 24"
269 preserveAspectRatio="xMinYMax">
270 <use xlink:href="#patternContent" />
271 </pattern>
272
273 <pattern id="noneXmidYmin"
274 patternUnits="userSpaceOnUse"
275 x="0" y="0"
276 width="32" height="16"
277 viewBox="0 0 24 24"
278 preserveAspectRatio="xMidYMin">
279 <use xlink:href="#patternContent" />
280 </pattern>
281
282 <pattern id="noneXmidYmid"
283 patternUnits="userSpaceOnUse"
284 x="0" y="0"
285 width="32" height="16"
286 viewBox="0 0 24 24"
287 preserveAspectRatio="xMidYMid">
288 <use xlink:href="#patternContent" />
289 </pattern>
290
291 <pattern id="noneXmidYmax"
292 patternUnits="userSpaceOnUse"
293 x="0" y="0"
294 width="32" height="16"
295 viewBox="0 0 24 24"
296 preserveAspectRatio="xMidYMax">
297 <use xlink:href="#patternContent" />
298 </pattern>
299
300 <pattern id="noneXmaxYmin"
301 patternUnits="userSpaceOnUse"
302 x="0" y="0"
303 width="32" height="16"
304 viewBox="0 0 24 24"
305 preserveAspectRatio="xMaxYMin">
306 <use xlink:href="#patternContent" />
307 </pattern>
308
309 <pattern id="noneXmaxYmid"
310 patternUnits="userSpaceOnUse"
311 x="0" y="0"
312 width="32" height="16"
313 viewBox="0 0 24 24"
314 preserveAspectRatio="xMaxYMid">
315 <use xlink:href="#patternContent" />
316 </pattern>
317
318 <pattern id="noneXmaxYmax"
319 patternUnits="userSpaceOnUse"
320 x="0" y="0"
321 width="32" height="16"
322 viewBox="0 0 24 24"
323 preserveAspectRatio="xMaxYMax">
324 <use xlink:href="#patternContent" />
325 </pattern>
326
327 <!-- ==================== -->
328 <!-- align = none -->
329 <!-- ==================== -->
330 <pattern id="meetNone"
331 patternUnits="userSpaceOnUse"
332 x="0" y="0"
333 width="32" height="16"
334 viewBox="0 0 24 24"
335 preserveAspectRatio="none meet">
336 <use xlink:href="#patternContent" />
337 </pattern>
338
339 <pattern id="sliceNone"
340 patternUnits="userSpaceOnUse"
341 x="0" y="0"
342 width="32" height="16"
343 viewBox="0 0 24 24"
344 preserveAspectRatio="none slice">
345 <use xlink:href="#patternContent" />
346 </pattern>
347
348 <pattern id="noneNone"
349 patternUnits="userSpaceOnUse"
350 x="0" y="0"
351 width="32" height="16"
352 viewBox="0 0 24 24"
353 preserveAspectRatio="none">
354 <use xlink:href="#patternContent" />
355 </pattern>
356
357 <rect id="xMxx" x="0" y="0" width="20" height="120" />
358 <rect id="yMxx" x="20" y="0" width="20" height="40" />
359 <rect id="sampleCell" x="40" y="0" width="100" height="40" />
360
361 <g id="xMxxBlock" stroke="black">
362 <use xlink:href="#xMxx" />
363 <use xlink:href="#yMxx" fill="rgb(255, 250, 210)"/>
364 <text class="label" stroke="none" fill="black"
365 text-anchor="middle" x="35" y="20"
366 transform="rotate(-90, 35, 20)">
367 yMin
368 </text>
369 <use xlink:href="#yMxx" y="40" fill="rgb(255, 240, 150)"/>
370 <text class="label" stroke="none" fill="black"
371 text-anchor="middle" x="35" y="60"
372 transform="rotate(-90, 35, 60)">
373 yMid
374 </text>
375 <use xlink:href="#yMxx" y="80" fill="rgb(255, 235, 120)"/>
376 <text class="label" stroke="none" fill="black"
377 text-anchor="middle" x="35" y="100"
378 transform="rotate(-90, 35, 100)">
379 yMax
380 </text>
381 </g>
382
383 <g id="sampleColumn" stroke="black" fill="none">
384 <use xlink:href="#sampleCell" fill="rgb(255, 250, 210)"/>
385 <use xlink:href="#sampleCell" y="40" fill="rgb(255, 240, 150)"/>
386 <use xlink:href="#sampleCell" y="80" fill="rgb(255, 235, 120)"/>
387 <use xlink:href="#sampleCell" y="120" fill="rgb(255, 250, 210)"/>
388 <use xlink:href="#sampleCell" y="160" fill="rgb(255, 240, 150)"/>
389 <use xlink:href="#sampleCell" y="200" fill="rgb(255, 235, 120)"/>
390 <use xlink:href="#sampleCell" y="240" fill="rgb(255, 250, 210)"/>
391 <use xlink:href="#sampleCell" y="280" fill="rgb(255, 240, 150)"/>
392 <use xlink:href="#sampleCell" y="320" fill="rgb(255, 235, 120)"/>
393 <use xlink:href="#sampleCell" y="360"/>
394 </g>
395
396 <rect id="columnHeader" x="40" y="-20" width="100" height="20" stroke="black"/>
397
398 </defs>
399
400 <g transform="translate(50, 80)">
401 <use xlink:href="#xMxxBlock" fill="rgb(255, 250, 210)"/>
402 <text class="label" stroke="none" fill="black"
403 text-anchor="middle" x="15" y="60"
404 transform="rotate(-90, 15, 60)">
405 xMin
406 </text>
407
408 <use xlink:href="#xMxxBlock" y="120" fill="rgb(255, 240, 150)"/>
409 <text class="label" stroke="none" fill="black"
410 text-anchor="middle" x="15" y="180"
411 transform="rotate(-90, 15, 180)">
412 xMid
413 </text>
414
415 <use xlink:href="#xMxxBlock" y="240" fill="rgb(255, 235, 120)"/>
416 <text class="label" stroke="none" fill="black"
417 text-anchor="middle" x="15" y="300"
418 transform="rotate(-90, 15, 300)">
419 xMax
420 </text>
421
422 <use xlink:href="#sampleColumn" />
423 <use xlink:href="#sampleColumn" x="100" />
424 <use xlink:href="#sampleColumn" x="200" />
425
426 <use xlink:href="#columnHeader" fill="none"/>
427 <use xlink:href="#columnHeader" x="100" fill="none"/>
428 <use xlink:href="#columnHeader" x="200" fill="none"/>
429
430 <text class="label" stroke="none" fill="black"
431 text-anchor="middle" x="90" y="-5">
432 meet
433 </text>
434
435 <text class="label" stroke="none" fill="black"
436 text-anchor="middle" x="190" y="-5">
437 slice
438 </text>
439
440 <text class="label" stroke="none" fill="black"
441 text-anchor="middle" x="290" y="-5">
442 none
443 </text>
444
445 <rect x="0" y="360" width="40" height="40" stroke="black" fill="none" />
446 <text class="label" stroke="none" fill="black"
447 text-anchor="middle" x="25" y="380"
448 transform="rotate(-90, 25, 380)">
449 none
450 </text>
451
452 <!-- ============================================ -->
453 <!-- Various pattern settings here -->
454 <!-- ============================================ -->
455
456 <!-- =============================== -->
457 <!-- meetOrSlice = meet -->
458 <!-- =============================== -->
459 <g>
460
461 <!-- xMxx = xMin -->
462 <use xlink:href="#testShape" fill="url(#meetXminYmin)" />
463 <use xlink:href="#testShape" fill="url(#meetXminYmid)" y="40"/>
464 <use xlink:href="#testShape" fill="url(#meetXminYmax)" y="80"/>
465
466 <!-- xMxx = xMid -->
467 <g transform="translate(0, 120)">
468 <use xlink:href="#testShape" fill="url(#meetXmidYmin)" />
469 <use xlink:href="#testShape" fill="url(#meetXmidYmid)" y="40"/>
470 <use xlink:href="#testShape" fill="url(#meetXmidYmax)" y="80"/>
471 </g>
472
473 <!-- xMxx = xMax -->
474 <g transform="translate(0, 240)">
475 <use xlink:href="#testShape" fill="url(#meetXmaxYmin)" />
476 <use xlink:href="#testShape" fill="url(#meetXmaxYmid)" y="40"/>
477 <use xlink:href="#testShape" fill="url(#meetXmaxYmax)" y="80"/>
478 </g>
479
480 </g>
481
482 <!-- =============================== -->
483 <!-- meetOrSlice = slice -->
484 <!-- =============================== -->
485 <g marker-start="url(#startEndMarker)" transform="translate(100, 0)"
486 marker-end="url(#startEndMarker)" stroke="black">
487
488 <!-- xMxx = xMin -->
489 <use xlink:href="#testShape" fill="url(#sliceXminYmin)" />
490 <use xlink:href="#testShape" fill="url(#sliceXminYmid)" y="40"/>
491 <use xlink:href="#testShape" fill="url(#sliceXminYmax)" y="80"/>
492
493 <!-- xMxx = xMid -->
494 <g transform="translate(0, 120)">
495 <use xlink:href="#testShape" fill="url(#sliceXmidYmin)" />
496 <use xlink:href="#testShape" fill="url(#sliceXmidYmid)" y="40"/>
497 <use xlink:href="#testShape" fill="url(#sliceXmidYmax)" y="80"/>
498 </g>
499
500 <!-- xMxx = xMax -->
501 <g transform="translate(0, 240)">
502 <use xlink:href="#testShape" fill="url(#sliceXmaxYmin)" />
503 <use xlink:href="#testShape" fill="url(#sliceXmaxYmid)" y="40"/>
504 <use xlink:href="#testShape" fill="url(#sliceXmaxYmax)" y="80"/>
505 </g>
506
507 </g>
508
509 <!-- =============================== -->
510 <!-- meetOrSlice = none -->
511 <!-- =============================== -->
512 <g marker-start="url(#startEndMarker)" transform="translate(200, 0)"
513 marker-end="url(#startEndMarker)" stroke="black">
514
515 <!-- xMxx = xMin -->
516 <use xlink:href="#testShape" fill="url(#noneXminYmin)" />
517 <use xlink:href="#testShape" fill="url(#noneXminYmid)" y="40"/>
518 <use xlink:href="#testShape" fill="url(#noneXminYmax)" y="80"/>
519
520 <!-- xMxx = xMid -->
521 <g transform="translate(0, 120)">
522 <use xlink:href="#testShape" fill="url(#noneXmidYmin)" />
523 <use xlink:href="#testShape" fill="url(#noneXmidYmid)" y="40"/>
524 <use xlink:href="#testShape" fill="url(#noneXmidYmax)" y="80"/>
525 </g>
526
527 <!-- xMxx = xMax -->
528 <g transform="translate(0, 240)">
529 <use xlink:href="#testShape" fill="url(#noneXmaxYmin)" />
530 <use xlink:href="#testShape" fill="url(#noneXmaxYmid)" y="40"/>
531 <use xlink:href="#testShape" fill="url(#noneXmaxYmax)" y="80"/>
532 </g>
533
534 </g>
535
536 <!-- =============================== -->
537 <!-- align = none -->
538 <!-- =============================== -->
539 <g marker-start="url(#startEndMarker)" transform="translate(0, 360)"
540 marker-end="url(#startEndMarker)" stroke="black">
541
542 <use xlink:href="#testShape" fill="url(#meetNone)" />
543 <use xlink:href="#testShape" fill="url(#sliceNone)" x="100"/>
544 <use xlink:href="#testShape" fill="url(#noneNone)" x="200"/>
545
546 </g>
547 </g>
548 </g>
549
550
551 <!-- ============================================================= -->
552 <!-- Batik sample mark -->
553 <!-- ============================================================= -->
554 <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
555
556 </svg>