Debian Codegraph @

samples/tests/spec/painting/markersOrientA.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 <!-- This test validates handling of the orient property on maker-start and -->
25 <!-- marker-end. -->
26 <!-- -->
27 <!-- @author [email protected] -->
28 <!-- @version $Id$ -->
29 <!-- ========================================================================= -->
30 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
31
32 <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">
33 <title>Marker Test</title>
34
35 <style type="text/css"><![CDATA[
36 .markedPath { fill:none; stroke:black; stroke-width:.5; }
37 ]]></style>
38
39 <g id="content">
40
41 <text class="title" x="50%" y="40">Markers, Orient 1/2</text>
42
43 <defs>
44 <g id="arrowMarker">
45
46 <g stroke="none" >
47 <circle r="3" />
48 <rect x="-1" y="0" width="2" height="7" />
49 <path d="M -3 6 l 6 0 l -3 3 z" />
50 </g>
51
52 </g>
53
54 <g id="crossHair" style="marker:none" stroke="black">
55 <line y1="-5" x2="0" y2="5" />
56 <line x1="-5" x2="5" y2="0" />
57 </g>
58
59 <g id="startEndCrossHairs">
60 <use x="0" y="20" xlink:href="#crossHair" />
61 <use x="30" y="0" xlink:href="#crossHair" />
62 </g>
63
64 <g id="startMidEndCrossHairs">
65 <use x="0" y="20" xlink:href="#crossHair" />
66 <use x="20" y="0" xlink:href="#crossHair" />
67 <use x="50" y="10" xlink:href="#crossHair" />
68 </g>
69
70 <pattern id="gridPattern" viewBox="-5 -5 10 10" x="-5" y="-5" width="10" height="10"
71 patternContentUnits="userSpaceOnUse" patternUnits="userSpaceOnUse">
72 <g stroke="rgb(245, 245, 255)" stroke-width="1">
73 <line x1="0" y1="-6" x2="0" y2="6" />
74 <line x1="-6" y1="0" x2="6" y2="0" />
75 </g>
76 </pattern>
77
78 <!-- ============================= -->
79 <!-- Simple Marker Definition -->
80 <!-- ============================= -->
81 <marker id="startMarker" markerWidth="48" markerHeight="32"
82 viewBox="-10 -3 13 6" orient="auto" refX="0" refY="0"
83 markerUnits="strokeWidth">
84 <g>
85 <use xlink:href="#arrowMarker" transform="rotate(90)" fill="crimson" />
86 </g>
87 </marker>
88
89 <marker id="endMarker" markerWidth="48" markerHeight="24"
90 viewBox="-3 -3 13 6" orient="auto" refX="0" refY="0"
91 markerUnits="strokeWidth">
92 <g>
93 <use xlink:href="#arrowMarker" transform="rotate(-90)" fill="orange"/>
94 </g>
95 </marker>
96
97 <marker id="midMarker" markerWidth="64" markerHeight="48"
98 viewBox="-5 -10 10 13" orient="auto" refX="0" refY="0"
99 markerUnits="strokeWidth">
100 <g>
101 <use xlink:href="#arrowMarker" transform="rotate(180)" fill="gold"/>
102 <line stroke="gold" x1="-5" y1="0" x2="5" y2="0" />
103 </g>
104 </marker>
105
106 </defs>
107
108 <g transform="translate(110, 120)">
109
110 <g id="grid" stroke="black" fill="none">
111 <rect x="-30" y="-25" width="300" height="350" fill="url(markersOrientA.svg#gridPattern)"/>
112
113 <rect x="-30" y="-45" width="300" height="20" fill="rgb(240, 240, 240)" />
114 <rect x="-50" y="-25" width="20" height="350" fill="rgb(240, 240, 240)" />
115
116 <line x1="70" y1="-45" x2="70" y2="325" />
117 <line x1="170" y1="-45" x2="170" y2="325" />
118 <line x1="-50" y1="45" x2="270" y2="45" />
119 <line x1="-50" y1="115" x2="270" y2="115" />
120 <line x1="-50" y1="185" x2="270" y2="185" />
121 <line x1="-50" y1="255" x2="270" y2="255" />
122
123 <g class="legend" text-anchor="middle" fill="black" stroke="none">
124 <text transform="translate(-35, 10) rotate(-90)">
125 moveTo
126 </text>
127
128 <text transform="translate(-35, 80) rotate(-90)">
129 lineTo
130 </text>
131
132 <text transform="translate(-35, 150) rotate(-90)">
133 quadTo
134 </text>
135
136 <text transform="translate(-35, 220) rotate(-90)">
137 cubicTo
138 </text>
139
140 <text transform="translate(-35, 290) rotate(-90)">
141 close
142 </text>
143 </g>
144 </g>
145
146 <g id="gridLabels" class="legend" text-anchor="middle">
147 <text x="20" y="-30">start/end</text>
148 <text x="120" y="-30">Middle w/ moveTo</text>
149 <text x="220" y="-30">Middle w/ lineTo</text>
150
151 </g>
152
153 <!-- ==================================== -->
154 <!-- The following 6 paths have two -->
155 <!-- points, validating the various -->
156 <!-- possibilities for start and end -->
157 <!-- orientations -->
158 <!-- Start is always a move to -->
159 <!-- ==================================== -->
160 <g marker-start="url(#startMarker)" marker-end="url(#endMarker)"
161 transform="translate(0, 0)" >
162
163
164 <!-- End is a moveTo -->
165 <path d="M 0 20 M 30 0" class="markedPath"/>
166 <use xlink:href="#startEndCrossHairs" />
167
168 <!-- End is a lineTo -->
169 <g transform="translate(0, 70)">
170 <path d="M 0 20 L 30 0" class="markedPath" />
171 <use xlink:href="#startEndCrossHairs" />
172 </g>
173
174 <!-- End is a quadTo -->
175 <g transform="translate(0, 140)">
176 <path d="M 0 20 Q 10 -20 30 0" class="markedPath"/>
177 <use xlink:href="#startEndCrossHairs" />
178 </g>
179
180 <!-- End is a cubicTo -->
181 <g transform="translate(0, 210)">
182 <path d="M 0 20 C 0 -15 20 -15 30 0" class="markedPath"/>
183 <use xlink:href="#startEndCrossHairs" />
184 </g>
185
186 <!-- End is a close -->
187 <g transform="translate(0, 280)" >
188 <path d="M 0 20 Z" class="markedPath"/>
189 <use xlink:href="#startEndCrossHairs" />
190 </g>
191 </g>
192
193 <!-- ==================================== -->
194 <!-- The following 5 paths have three -->
195 <!-- points, validating the various -->
196 <!-- possibilities for middle orientation -->
197 <!-- when the segment ending on the -->
198 <!-- middle point is a moveTo -->
199 <!-- -->
200 <!-- in : moveTo -->
201 <!-- ==================================== -->
202 <g marker-mid="url(#midMarker)"
203 transform="translate(100, 0)" >
204
205
206 <!-- Out is a moveTo -->
207 <path d="M 0 20 L 0 20 M 0 20 M 20 0 M 50 10" class="markedPath"/>
208 <use xlink:href="#startMidEndCrossHairs" />
209
210 <!-- Out is a lineTo -->
211 <g transform="translate(0, 70)">
212 <path d="M 0 20 L 0 20 M 0 20 M 20 0 L 50 10" class="markedPath" />
213 <use xlink:href="#startMidEndCrossHairs" />
214 </g>
215
216 <!-- Out is a quadTo -->
217 <g transform="translate(0, 140)">
218 <path d="M 0 20 L 0 20 M 0 20 M 20 0 Q 50 -30 50 10" class="markedPath" />
219 <use xlink:href="#startMidEndCrossHairs" />
220 </g>
221
222 <!-- Out is a cubicTo -->
223 <g transform="translate(0, 210)">
224 <path d="M 0 20 L 0 20 M 0 20 M 20 0 C 40 -10 80 -20 50 10" class="markedPath" />
225 <use xlink:href="#startMidEndCrossHairs" />
226 </g>
227
228 <!-- Out is a close -->
229 <g transform="translate(0, 280)">
230 <path d="M 0 20 L 0 20 M 0 20 M 20 0 Z" class="markedPath" />
231 <use xlink:href="#startMidEndCrossHairs" />
232 </g>
233
234 </g>
235
236 <!-- ==================================== -->
237 <!-- The following 5 paths have three -->
238 <!-- points, validating the various -->
239 <!-- possibilities for middle orientation -->
240 <!-- when the segment ending on the -->
241 <!-- middle point is a lineTo -->
242 <!-- -->
243 <!-- in : moveTo -->
244 <!-- ==================================== -->
245 <g marker-mid="url(#midMarker)"
246 transform="translate(200, 0)" >
247
248
249 <!-- Out is a moveTo -->
250 <path d="M 0 20 L 20 0 M 50 10" class="markedPath"/>
251 <use xlink:href="#startMidEndCrossHairs" />
252
253 <!-- Out is a lineTo -->
254 <g transform="translate(0, 70)">
255 <path d="M 0 20 L 20 0 L 50 10" class="markedPath" />
256 <use xlink:href="#startMidEndCrossHairs" />
257 </g>
258
259 <!-- Out is a quadTo -->
260 <g transform="translate(0, 140)">
261 <path d="M 0 20 L 20 0 Q 50 0 50 10" class="markedPath" />
262 <use xlink:href="#startMidEndCrossHairs" />
263 </g>
264
265 <!-- Out is a cubicTo -->
266 <g transform="translate(0, 210)">
267 <path d="M 0 20 L 20 0 C 40 -10 80 -20 50 10" class="markedPath" />
268 <use xlink:href="#startMidEndCrossHairs" />
269 </g>
270
271 <!-- Out is a close -->
272 <g transform="translate(0, 280)">
273 <path d="M 0 20 L 20 0 Z" class="markedPath" />
274 <use xlink:href="#startMidEndCrossHairs" />
275 </g>
276
277 </g>
278 </g>
279 </g>
280
281 <!-- ============================================================= -->
282 <!-- Batik sample mark -->
283 <!-- ============================================================= -->
284 <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
285
286 </svg>