blob: c7b1218887edd1658cc3786f1b0c5bccbe1c8ab6 (
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
|
---
title: textPath
slug: Web/SVG/Element/textPath
translation_of: Web/SVG/Element/textPath
---
<div>{{SVGRef}}</div>
<p>Neben der Fähigkeit, Text auf einer Geraden Linie zu zeichnen, kann SVG diesen auch entlang der Form eines {{ SVGElement("path") }} Elements platzieren. Um von dieser Funktion Gebrauch zu machen, füge den gewünschten Text in einem<code>textPath</code> Element mit einem<code>xlink:href</code> Attribut mit einer Referenz zu dem {{ SVGElement("path") }} Element.</p>
<h2 id="Usage_context">Usage context</h2>
<p>{{svginfo}}</p>
<h2 id="Example">Example</h2>
<pre class="brush: html"><svg width="100%" height="100%" viewBox="0 0 1000 300"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<path id="MyPath"
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" />
</defs>
<use xlink:href="#MyPath" fill="none" stroke="red" />
<text font-family="Verdana" font-size="42.5">
<textPath xlink:href="#MyPath">
We go up, then we go down, then up again
</textPath>
</text>
<!-- Show outline of the viewport using 'rect' element -->
<rect x="1" y="1" width="998" height="298"
fill="none" stroke="black" stroke-width="2" />
</svg>
</pre>
<p>Live result:</p>
<p>{{EmbedLiveSample("Example",500,175)}}</p>
<h2 id="Attributes">Attributes</h2>
<h3 id="Global_attributes">Global attributes</h3>
<ul>
<li><a href="/en/SVG/Attribute#ConditionalProccessing" title="en/SVG/Attribute#ConditionalProccessing">Conditional processing attributes</a> »</li>
<li><a href="/en/SVG/Attribute#Core" title="en/SVG/Attribute#Core">Core attributes</a> »</li>
<li><a href="/en/SVG/Attribute#GraphicalEvent" title="en/SVG/Attribute#GraphicalEvent">Graphical event attributes</a> »</li>
<li><a href="/en/SVG/Attribute#Presentation" title="en/SVG/Attribute#Presentation">Presentation attributes</a> »</li>
<li><a href="/en/SVG/Attribute#XLink" title="en/SVG/Attribute#XLink">Xlink attributes</a> »</li>
<li>{{ SVGAttr("class") }}</li>
<li>{{ SVGAttr("style") }}</li>
<li>{{ SVGAttr("externalResourcesRequired") }}</li>
</ul>
<h3 id="Specific_attributes">Specific attributes</h3>
<ul>
<li>{{ SVGAttr("startOffset") }}</li>
<li>{{ SVGAttr("method") }}</li>
<li>{{ SVGAttr("spacing") }}</li>
<li>{{ SVGAttr("xlink:href") }}</li>
</ul>
<h2 id="DOM_Interface">DOM Interface</h2>
<p>This element implements the <code><a href="/en/DOM/SVGTextPathElement" title="en/DOM/SVGTextPathElement">SVGTextPathElement</a></code> interface.</p>
|