1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!-- =====================================================================-->
3 <!-- animate-elem-46-t.svg -->
5 <!-- Animation of text-anchor -->
7 <!-- Author : Vincent Hardy. -->
8 <!-- =====================================================================--><!DOCTYPE svg PUBLIC
"-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
10 <svg xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink" version=
"1.1" baseProfile=
"tiny" id=
"svg-root" width=
"100%" height=
"100%" viewBox=
"0 0 480 360">
11 <SVGTestCase xmlns:
testcase=
"http://www.w3.org/2000/02/svg/testsuite/description/" xmlns=
"http://www.w3.org/2000/02/svg/testsuite/description/" reviewer=
"CN" owner=
"VH" desc=
"Animation of text properties: text-anchor, font-size, font-family, font-style and font-weight" status=
"accepted" version=
"$Revision: 1.8 $" testname=
"$RCSfile: animate-elem-46-t.svg,v $">
14 This test validates the operation of the animate element on the various
15 text and font properties. This test is very similar to animate-elem-
77-t.svg
16 which uses the set element instead of the animate element to modify graphics
21 For each text or font properties, there are three tests. One animates the text or font
22 property directly on a text element which uses the
23 property. The other two tests apply the animation on a container element (g and
24 a), and validate that the animated property is inherited by children text elements.
28 For each animation test, the element on which the animation is applied is also
29 translated by an animation so that the various states of the animation can
30 be checked more easily. There is a gray reference marker which shows
31 the expected animation state at the begining of the animation, mid-way, or at the
36 Only the animation of font-size should show a continuous change of the font size.
40 The following animations have a discrete behavior: text-anchor, font-family,
41 font-style, font-weight.
45 <g transform=
"translate(80, 80)">
47 <g transform=
"translate(20,10)" text-anchor=
"end" font-size=
"14">
48 <text x=
"5" y=
"15">text-anchor
</text>
49 <text x=
"5" y=
"50">font-size
</text>
50 <text x=
"5" y=
"85">font-family
</text>
51 <text x=
"5" y=
"120">font-style
</text>
52 <text x=
"5" y=
"155">font-weight
</text>
55 <g id=
"type" transform=
"translate(90, -10)" text-anchor=
"middle" font-size=
"14">
56 <text x=
"20" y=
"3"><text
></text>
57 <text x=
"135" y=
"3"><g
></text>
58 <text x=
"250" y=
"3"><a
></text>
61 <g transform=
"translate(80,5)" text-anchor=
"start" font-size=
"20" fill=
"rgb(204,0,102)">
64 <g id=
"animateZeroRef" font-size=
"30" font-weight=
"bold">
65 <text x=
"0" y=
"20" fill=
"#aaa" text-anchor=
"end">A
</text>
66 <rect x=
"-2" y=
"18" width=
"4" height=
"4" fill=
"#aaa"/>
67 <text x=
"0" y=
"20" fill=
"#aaa" text-anchor=
"middle" transform=
"translate(30,0)">A
</text>
68 <rect x=
"-2" y=
"18" width=
"4" height=
"4" fill=
"#aaa" transform=
"translate(30,0)"/>
69 <text x=
"0" y=
"20" fill=
"#aaa" text-anchor=
"start" transform=
"translate(60,0)">A
</text>
70 <rect x=
"-2" y=
"18" width=
"4" height=
"4" fill=
"#aaa" transform=
"translate(60,0)"/>
71 <rect x=
"-2" y=
"18" width=
"4" height=
"4">
72 <animateTransform attributeName=
"transform" type=
"translate" values=
"0;30;60" dur=
"3s" fill=
"freeze" calcMode=
"discrete"/>
77 <use xlink:
href=
"#animateZeroRef"/>
78 <use xlink:
href=
"#animateZeroRef" x=
"110"/>
79 <use xlink:
href=
"#animateZeroRef" x=
"220"/>
81 <text id=
"textID_0" x=
"0" y=
"20" text-anchor=
"end" font-size=
"30" font-weight=
"bold">A
</text>
82 <animate xlink:
href=
"#textID_0" attributeName=
"text-anchor" values=
"end;middle;start" dur=
"3s" fill=
"freeze"/>
83 <animateTransform xlink:
href=
"#textID_0" attributeName=
"transform" type=
"translate" values=
"0;30;60" dur=
"3s" fill=
"freeze" calcMode=
"discrete"/>
86 <g transform=
"translate(110, 0)" text-anchor=
"end" font-size=
"30" font-weight=
"bold">
87 <animate attributeName=
"text-anchor" values=
"end;middle;start" dur=
"3s" fill=
"freeze"/>
88 <animateTransform attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze" additive=
"sum"/>
89 <text x=
"0" y=
"20">A
</text>
92 <a transform=
"translate(220, 0)" text-anchor=
"end" font-size=
"30" font-weight=
"bold">
93 <animate attributeName=
"text-anchor" values=
"end;middle;start" dur=
"3s" fill=
"freeze"/>
94 <animateTransform attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze" additive=
"sum"/>
95 <text x=
"0" y=
"20">A
</text>
99 <g id=
"animateOne" transform=
"translate(0,35)">
101 <g id=
"animateOneRef" font-weight=
"bold" text-anchor=
"start">
102 <text x=
"0" y=
"20" fill=
"#aaa" font-size=
"30">A
</text>
103 <text x=
"0" y=
"20" fill=
"#aaa" font-size=
"12" transform=
"translate(30,0)">A
</text>
104 <text x=
"0" y=
"20" fill=
"#aaa" font-size=
"30" transform=
"translate(60,0)">A
</text>
108 <use xlink:
href=
"#animateOneRef"/>
109 <use xlink:
href=
"#animateOneRef" x=
"110"/>
110 <use xlink:
href=
"#animateOneRef" x=
"220"/>
112 <text id=
"textID_1" x=
"0" y=
"20" font-size=
"12" font-weight=
"bold">A
</text>
113 <animate xlink:
href=
"#textID_1" attributeName=
"font-size" values=
"30;12;30" dur=
"3s" fill=
"freeze"/>
114 <animateTransform xlink:
href=
"#textID_1" attributeName=
"transform" type=
"translate" from=
"0" to=
"60" dur=
"3s" fill=
"freeze"/>
116 <g transform=
"translate(110, 0)" font-size=
"12" font-weight=
"bold">
117 <animate attributeName=
"font-size" values=
"30;12;30" dur=
"3s" fill=
"freeze"/>
118 <animateTransform attributeName=
"transform" type=
"translate" from=
"0" to=
"60" dur=
"3s" fill=
"freeze" additive=
"sum"/>
119 <text x=
"0" y=
"20">A
</text>
122 <a transform=
"translate(220,0)" font-size=
"12" font-weight=
"bold">
123 <animate attributeName=
"font-size" values=
"30;12;30" dur=
"3s" fill=
"freeze"/>
124 <animateTransform attributeName=
"transform" type=
"translate" from=
"0" to=
"60" dur=
"3s" fill=
"freeze" additive=
"sum"/>
125 <text x=
"0" y=
"20">A
</text>
129 <g id=
"animateTwo" transform=
"translate(0,70)">
131 <g id=
"animateTwoRef" font-weight=
"bold" font-size=
"30">
132 <text x=
"0" y=
"20" fill=
"#aaa" font-family=
"sans-serif">A
</text>
133 <text x=
"30" y=
"20" fill=
"#aaa" font-family=
"serif">A
</text>
134 <text x=
"60" y=
"20" font-size=
"30" fill=
"#aaa" font-family=
"sans-serif">A
</text>
137 <use xlink:
href=
"#animateTwoRef"/>
138 <use xlink:
href=
"#animateTwoRef" x=
"110"/>
139 <use xlink:
href=
"#animateTwoRef" x=
"220"/>
141 <text id=
"textID_2" x=
"0" y=
"20" font-weight=
"bold" font-size=
"30">A
</text>
142 <animate xlink:
href=
"#textID_2" attributeName=
"font-family" values=
"sans-serif;serif;sans-serif" dur=
"3s" fill=
"freeze"/>
143 <animateTransform xlink:
href=
"#textID_2" attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze"/>
145 <g font-weight=
"bold" font-size=
"30" transform=
"translate(110,0)">
146 <animate attributeName=
"font-family" values=
"sans-serif;serif;sans-serif" dur=
"3s" fill=
"freeze"/>
147 <animateTransform attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze" additive=
"sum"/>
148 <text x=
"0" y=
"20">A
</text>
151 <a font-weight=
"bold" font-size=
"30" transform=
"translate(220,0)">
152 <animate attributeName=
"font-family" values=
"sans-serif;serif;sans-serif" dur=
"3s" fill=
"freeze"/>
153 <animateTransform attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze" additive=
"sum"/>
154 <text x=
"0" y=
"20">A
</text>
158 <g id=
"animateThree" transform=
"translate(0,105)">
160 <g id=
"animateThreeRef" font-size=
"30" font-weight=
"bold">
161 <text x=
"0" y=
"20" font-size=
"30" fill=
"#aaa" font-style=
"normal">A
</text>
162 <text x=
"30" y=
"20" font-size=
"30" fill=
"#aaa" font-style=
"italic">A
</text>
163 <text x=
"60" y=
"20" font-size=
"30" fill=
"#aaa" font-style=
"normal">A
</text>
166 <use xlink:
href=
"#animateThreeRef"/>
167 <use xlink:
href=
"#animateThreeRef" x=
"110"/>
168 <use xlink:
href=
"#animateThreeRef" x=
"220"/>
170 <text id=
"textID_3" x=
"0" y=
"20" font-size=
"30" font-weight=
"bold">A
</text>
171 <animate xlink:
href=
"#textID_3" attributeName=
"font-style" values=
"normal;italic;normal" dur=
"3s" fill=
"freeze"/>
172 <animateTransform xlink:
href=
"#textID_3" attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze"/>
174 <g transform=
"translate(110,0)" font-size=
"30" font-weight=
"bold">
175 <animate attributeName=
"font-style" values=
"normal;italic;normal" dur=
"3s" fill=
"freeze"/>
176 <animateTransform attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze" additive=
"sum"/>
177 <text x=
"0" y=
"20" font-size=
"30">A
</text>
180 <a transform=
"translate(220,0)" font-size=
"30" font-weight=
"bold">
181 <animate attributeName=
"font-style" values=
"normal;italic;normal" dur=
"3s" fill=
"freeze"/>
182 <animateTransform attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze" additive=
"sum"/>
183 <text x=
"0" y=
"20" font-size=
"30">A
</text>
188 <g id=
"animateFour" transform=
"translate(0,140)">
190 <g id=
"animateFourRef" font-size=
"30">
191 <text x=
"0" y=
"20" fill=
"#aaa" font-weight=
"bold">A
</text>
192 <text x=
"30" y=
"20" fill=
"#aaa" font-weight=
"normal">A
</text>
193 <text x=
"60" y=
"20" fill=
"#aaa" font-weight=
"bold">A
</text>
197 <use xlink:
href=
"#animateFourRef"/>
198 <use xlink:
href=
"#animateFourRef" x=
"110"/>
199 <use xlink:
href=
"#animateFourRef" x=
"220"/>
201 <text id=
"textID_4" x=
"0" y=
"20" font-size=
"30">A
</text>
202 <animate xlink:
href=
"#textID_4" attributeName=
"font-weight" values=
"bold;normal;bold" dur=
"3s" fill=
"freeze"/>
203 <animateTransform xlink:
href=
"#textID_4" attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze"/>
205 <g transform=
"translate(110,0)" font-size=
"30">
206 <animate attributeName=
"font-weight" values=
"bold;normal;bold" dur=
"3s" fill=
"freeze"/>
207 <animateTransform attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze" additive=
"sum"/>
208 <text x=
"0" y=
"20">A
</text>
211 <g transform=
"translate(220,0)" font-size=
"30">
212 <animate attributeName=
"font-weight" values=
"bold;normal;bold" dur=
"3s" fill=
"freeze"/>
213 <animateTransform attributeName=
"transform" type=
"translate" values=
"0;30;60" calcMode=
"discrete" dur=
"3s" fill=
"freeze" additive=
"sum"/>
214 <text x=
"0" y=
"20">A
</text>
219 <text id=
"revision" x=
"10" y=
"340" font-size=
"40" stroke=
"none" fill=
"black">$Revision:
1.8 $
</text>
220 <rect id=
"test-frame" x=
"1" y=
"1" width=
"478" height=
"358" fill=
"none" stroke=
"#000000"/>