Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / batik / text / textLength.svg
blob2322291f3c90600095061d8bad1cbc3de9d7d7a0
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
3 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
5 <!--
7 Copyright 2002 The Apache Software Foundation
9 Licensed under the Apache License, Version 2.0 (the "License");
10 you may not use this file except in compliance with the License.
11 You may obtain a copy of the License at
13 http://www.apache.org/licenses/LICENSE-2.0
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
21 -->
22 <!-- ====================================================================== -->
23 <!-- Tests text-anchor on tspan elements -->
24 <!-- -->
25 <!-- @author deweese@apache.org -->
26 <!-- @version $Id: textLength.svg,v 1.4 2004/08/18 07:12:22 vhardy Exp $ -->
27 <!-- ====================================================================== -->
28 <?xml-stylesheet type="text/css" href="../resources/test.css" ?>
30 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="450" height="500" viewBox="0 0 450 500">
32 <text class="title" x="50%" y="20">textLength with Anchor</text>
35 <defs>
36 <g id="fill-rgn">
37 <rect x="200" y="5" width="50" height="20"
38 fill="#DDE8FF" stroke="none"/>
39 <line x1="225" y1="3" x2="225" y2="27" stroke="red"/>
40 </g>
42 <g id="bg1">
43 <rect x="50" y="0" width ="350" height="45"
44 fill="lightGrey" stroke="black"/>
45 <use xlink:href="#fill-rgn"/>
46 </g>
48 <g id="bg2">
49 <rect x="50" y="0" width ="350" height="45"
50 fill="white" stroke="black"/>
51 <use xlink:href="#fill-rgn"/>
52 </g>
53 </defs>
55 <g font-size="12" >
56 <!-- no lengthadjust -->
57 <g transform="translate(0, 30)">
58 <use xlink:href="#bg1"/>
59 <text x="225" y="19" text-anchor="middle">xml-batik</text>
60 <text x="225" y="40" text-anchor="middle">No textLength</text>
61 </g>
63 <!-- With lengthAdjust spacingAndGlyphs -->
64 <g transform="translate(0, 75)">
65 <use xlink:href="#bg2"/>
66 <text x="225" y="19" text-anchor="middle" textLength="50"
67 lengthAdjust="spacingAndGlyphs">B</text>
68 <text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs"</text>
69 </g>
71 <!-- with lengthAdjust spacing -->
72 <g transform="translate(0, 120)">
73 <use xlink:href="#bg1"/>
74 <text x="225" y="19" text-anchor="middle" textLength="50"
75 lengthAdjust="spacing">B</text>
76 <text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacing"</text>
77 </g>
79 <!-- with lengthAdjust spacing -->
80 <g transform="translate(0, 165)">
81 <use xlink:href="#bg2"/>
82 <text x="225" y="19" text-anchor="middle" textLength="50"
83 lengthAdjust="spacingAndGlyphs">Batik</text>
84 <text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs"</text>
85 </g>
87 <!-- with lengthAdjust spacing -->
88 <g transform="translate(0, 210)">
89 <use xlink:href="#bg1"/>
90 <text x="225" y="19" text-anchor="middle" textLength="50"
91 lengthAdjust="spacing">Batik</text>
92 <text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacing"</text>
93 </g>
95 <!-- large number -->
96 <g transform="translate(0, 255)">
97 <use xlink:href="#bg2"/>
98 <text x="225" y="19" text-anchor="middle" textLength="50"
99 lengthAdjust="spacingAndGlyphs">Apache Batik</text>
100 <text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs" (shrinking)</text>
101 </g>
103 <!-- large number, no anchor -->
104 <g transform="translate(0, 300)">
105 <use xlink:href="#bg1"/>
106 <text x="200" y="19" textLength="50"
107 lengthAdjust="spacingAndGlyphs">Apache Batik</text>
108 <text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs" (no anchor)</text>
109 </g>
111 <!-- large number, tspan -->
112 <g transform="translate(0, 345)">
113 <use xlink:href="#bg2"/>
114 <text x="225" y="19" text-anchor="middle" textLength="50"
115 lengthAdjust="spacingAndGlyphs">Apache <tspan fill="red">Batik</tspan>!!</text>
116 <text x="225" y="40" text-anchor="middle">textLength="50" lengthAdjust="spacingAndGlyphs" (tspan)</text>
117 </g>
119 <!-- Big Font Squeezed alot -->
120 <g transform="translate(0, 390)">
121 <rect x="50" y="0" width ="350" height="95"
122 fill="lightGrey" stroke="black"/>
123 <rect x="112.5" y="5" width="25" height="80"
124 fill="#DDE8FF" stroke="none"/>
125 <line x1="125" y1="3" x2="125" y2="87" stroke="red"/>
126 <text x="125" y="79" text-anchor="middle" textLength="25"
127 lengthAdjust="spacingAndGlyphs"
128 font-size="100">B a t i k</text>
129 <text x="160" y="40">lengthAdjust="spacingAndGlyphs"
130 <tspan x="160" dy="1.2em">textLength="25"</tspan>
131 <tspan x="160" dy="1.2em">font-size="100"</tspan></text>
132 </g>
133 </g>
135 <!-- ============================================================= -->
136 <!-- Batik sample mark -->
137 <!-- ============================================================= -->
138 <use xlink:href="../resources/batikLogo.svg#Batik_Tag_Box" />
139 </svg>