Debian Codegraph @

samples/tests/spec/text/textOnPath.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 <!-- Tests various text on a path -->
25 <!-- -->
26 <!-- @author [email protected] -->
27 <!-- @version $Id$ -->
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>Text on a path test</title>
33
34 <g id="content">
35
36 <text class="title" x="50%" y="40">Text on a path test</text>
37
38 <defs>
39 <path id="Path2" style="fill:none; stroke:blue;" transform="scale(0.15,0.15)"
40 d="M 100 200 C 200 100 300 0 400 100 C 500 200 600 300 700 200 C 800 100 900 100 900 100"/>
41 <path id="Path1" style="fill:none; stroke:blue;" transform="scale(0.30,0.50)"
42 d="M 100 100 C100 0 400 00 400 100"/>
43
44 </defs>
45
46 <g transform="translate(0,70)">
47 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
48 <text font-size="20" style="text-anchor:start">
49 <textPath xlink:href="#Path1" startOffset="0%">Text <tspan fill="red" dy="-10">on</tspan><tspan dy="10"> a Path</tspan></textPath>
50 </text>
51 <text font-size="10" x="35" y="60">startOffset="0%"</text>
52 <text font-size="10" x="35" y="70">text-anchor="start"</text>
53 </g>
54
55
56 <g transform="translate(150,70)">
57 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
58 <text font-size="20" style="text-anchor:middle">
59 <textPath xlink:href="#Path1" startOffset="0%">Text <tspan fill="red" dy="-10">on</tspan><tspan dy="10"> a Path</tspan></textPath>
60 </text>
61 <text font-size="10" x="35" y="60">startOffset="0%"</text>
62 <text font-size="10" x="35" y="70">text-anchor="middle"</text>
63 </g>
64
65 <g transform="translate(300,70)">
66 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
67 <text font-size="20" style="text-anchor:end">
68 <textPath xlink:href="#Path1" startOffset="50%">Text <tspan fill="red" dy="-10">on</tspan><tspan dy="10"> a Path</tspan></textPath>
69 </text>
70 <text font-size="10" x="35" y="60">startOffset="50%"</text>
71 <text font-size="10" x="35" y="70">text-anchor="end"</text>
72 </g>
73
74
75 <g transform="translate(0,170)">
76 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
77 <text font-size="20" style="text-anchor:start">
78 <textPath xlink:href="#Path1" startOffset="50%">Text <tspan fill="red" dy="-10">on</tspan><tspan dy="10"> a Path</tspan></textPath>
79 </text>
80 <text font-size="10" x="35" y="60">startOffset="50%"</text>
81 <text font-size="10" x="35" y="70">text-anchor="start"</text>
82 </g>
83
84
85 <g transform="translate(150,170)">
86 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
87 <text font-size="20" style="text-anchor:middle">
88 <textPath xlink:href="#Path1" startOffset="50%">Text <tspan fill="red" dy="-10">on</tspan><tspan dy="10"> a Path</tspan></textPath>
89 </text>
90 <text font-size="10" x="35" y="60">startOffset="50%"</text>
91 <text font-size="10" x="35" y="70">text-anchor="middle"</text>
92 </g>
93
94 <g transform="translate(300,170)">
95 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
96 <text font-size="20" style="text-anchor:end">
97 <textPath xlink:href="#Path1" startOffset="100%">Text <tspan fill="red" dy="-10">on</tspan><tspan dy="10"> a Path</tspan></textPath>
98 </text>
99 <text font-size="10" x="35" y="60">startOffset="100%"</text>
100 <text font-size="10" x="35" y="70">text-anchor="end"</text>
101 </g>
102
103
104 <g transform="translate(0,270)">
105 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
106 <text font-size="20" style="text-anchor:start">
107 <textPath xlink:href="#Path1" startOffset="35">Text <tspan fill="red" dy="-10">on</tspan><tspan dy="10"> a Path</tspan></textPath>
108 </text>
109 <text font-size="10" x="35" y="60">startOffset="35"</text>
110 <text font-size="10" x="35" y="70">text-anchor="start"</text>
111 </g>
112
113
114 <g transform="translate(150,270)">
115 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
116 <text font-size="20" style="text-anchor:middle">
117 <textPath xlink:href="#Path1" startOffset="35">Text <tspan fill="red" dy="-10">on</tspan><tspan dy="10"> a Path</tspan></textPath>
118 </text>
119 <text font-size="10" x="35" y="60">startOffset="35"</text>
120 <text font-size="10" x="35" y="70">text-anchor="middle"</text>
121 </g>
122
123 <g transform="translate(300,270)">
124 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
125 <text font-size="20" style="text-anchor:end">
126 <textPath xlink:href="#Path1" startOffset="35">Text <tspan fill="red" dy="-10">on</tspan><tspan dy="10"> a Path</tspan></textPath>
127 </text>
128 <text font-size="10" x="35" y="60">startOffset="35"</text>
129 <text font-size="10" x="35" y="70">text-anchor="end"</text>
130 </g>
131
132
133
134 <g transform="translate(10,370)">
135 <use xlink:href="#Path2" style="fill:none; stroke:blue; stroke-width:2"/>
136 <text font-size="15">
137 <textPath xlink:href="#Path2"><tspan baseline-shift="super" fill="green">super</tspan> and <tspan baseline-shift="sub" fill="red">sub</tspan>scripts</textPath>
138 </text>
139 <text font-size="10" x="20" y="60">baseline-shift="super"</text>
140 <text font-size="10" x="20" y="70">and baseline-shift="sub"</text>
141 </g>
142
143
144 <g transform="translate(155,370)">
145 <use xlink:href="#Path2" style="fill:none; stroke:blue; stroke-width:2"/>
146 <text font-size="15">
147 <textPath xlink:href="#Path2"><tspan baseline-shift="+20%" fill="green">positive</tspan> and <tspan baseline-shift="-20%" fill="red">negative </tspan></textPath>
148 </text>
149 <text font-size="10" x="20" y="60">baseline-shift="+/-20%"</text>
150 </g>
151
152 <g transform="translate(300,390)">
153 <g transform="scale(0.5)">
154 <use xlink:href="#Path1" style="fill:none; stroke:blue; stroke-width:2"/>
155 <text font-size="30" x="30" y="-20">before path
156 <textPath xlink:href="#Path1" fill="red" startOffset="10%">on path</textPath> after path
157 </text>
158 </g>
159 <text font-size="10" x="15" y="40">text before/after textPath</text>
160 </g>
161
162 </g>
163
164 <!-- ============================================================= -->
165 <!-- Batik sample mark -->
166 <!-- ============================================================= -->
167 <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
168
169 </svg>
170