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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
<svg version="1.1" baseProfile="tiny" id="svg-root"
width="100%" height="100%" viewBox="0 0 480 360"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!--======================================================================-->
<!--= SVG 1.1 2nd Edition Test Case =-->
<!--======================================================================-->
<!--= Copyright 2009 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, European Research Consortium for =-->
<!--= Informatics and Mathematics (ERCIM), Keio University). =-->
<!--= All Rights Reserved. =-->
<!--= See http://www.w3.org/Consortium/Legal/. =-->
<!--======================================================================-->
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
template-version="1.4" reviewer="AE" author="VH" status="accepted"
version="$Revision: 1.12 $" testname="$RCSfile: text-text-04-t.svg,v $">
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/text.html#TextElement">
<p>
The purpose of this test is to validate proper handling of
the text element's x and y attributes.
In the various samples, a orange marker shows the text's (0,0)
coordinate. The blue markers show the current text positions.
These are either defined by absolute x/y positioning or they
are computed from the embeded font's glyphs advances.
</p>
<p>
The first text sample shows a reference piece of text.
</p>
<p>
The second text sample (x all) shows a piece of text where
all the glyphs are positioned along the x axis.
</p>
<p>
The third text sample (x more) is a text element where there
are more x values than characters (5 values for 4 characters).
The last x value should be ignored and the result should
be the same as the third sample.
</p>
<p>
The fourth text sample (x fewer) is a text element where there
are fewer x values than characters (3 values for 4 characters).
The last character should not be positioned but laid out normally,
following its previous character sibling.
</p>
<p>
The fifth (y all), sixth (y more) and seventh (y fewer) text sample
parallel the second,
third and fourth test, but for the y attribute values.
</p>
<p>
The samples in the right column show combinations of x/y
value sets.
</p>
</d:testDescription>
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
<p>
Run the test. No interaction required.
</p>
</d:operatorScript>
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
<p>
In all the above tests, blue markers represent the expected glyph
positions. The orange markers are showing positions where no glyph
should appear. The glyphs are black squares of increasing sizes.
</p>
</d:passCriteria>
</d:SVGTestCase>
<title id="test-title">$RCSfile: text-text-04-t.svg,v $</title>
<style type="text/css">
@font-face {
font-family: embeded;
src: url(woffs/embeded-text-text-04.woff) format("woff");
}
</style>
<defs>
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
<font-face-src>
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
</font-face-src>
</font-face>
<font id="embeded" horiz-adv-x="224">
<font-face font-family="embeded" units-per-em="1000" ascent="1000" descent="-250" alphabetic="0"/>
<missing-glyph horiz-adv-x="800" d="M50 0V800H750V0H50ZM700 50V750H100V50H700Z"/>
<glyph unicode="1" glyph-name="gl_1" horiz-adv-x="750" d="M 0 0 L 250 0 L 250 250 L 0 250 Z"/>
<glyph unicode="2" glyph-name="gl_2" horiz-adv-x="750" d="M 0 0 L 500 0 L 500 500 L 0 500 Z"/>
<glyph unicode="3" glyph-name="gl_3" horiz-adv-x="750" d="M 0 0 L 750 0 L 750 750 L 0 750 Z"/>
<glyph unicode="4" glyph-name="gl_4" horiz-adv-x="750" d="M 0 0 L 1000 0 L 1000 1000 L 0 1000 Z"/>
</font>
</defs>
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
<g font-size="16">
<g id="reference" transform="translate(130, 40)">
<text text-anchor="end" x="-30">Reference</text>
<g>
<use xlink:href="#marker" x="0" fill="#8888FF"/>
<use xlink:href="#marker" x="15" fill="#8888FF"/>
<use xlink:href="#marker" x="30" fill="#8888FF"/>
<use xlink:href="#marker" x="45" fill="#8888FF"/>
<text id="ref" font-family="embeded" font-size="20">1234</text>
</g>
</g>
<defs>
<rect id="marker" x="-4" y="-4" width="8" height="8"/>
</defs>
<g id="xAll" transform="translate(130, 80)">
<text text-anchor="end" x="-30">x all</text>
<use xlink:href="#marker" x="0" fill="orange"/>
<use xlink:href="#marker" x="20" fill="#8888FF"/>
<use xlink:href="#marker" x="40" fill="#8888FF"/>
<use xlink:href="#marker" x="60" fill="#8888FF"/>
<use xlink:href="#marker" x="80" fill="#8888FF"/>
<text font-family="embeded" font-size="20" x="20 40 60 80">1234</text>
</g>
<g id="xMore" transform="translate(130, 120)">
<text text-anchor="end" x="-30">x more</text>
<use xlink:href="#marker" x="0" fill="orange"/>
<use xlink:href="#marker" x="20" fill="#8888FF"/>
<use xlink:href="#marker" x="40" fill="#8888FF"/>
<use xlink:href="#marker" x="60" fill="#8888FF"/>
<use xlink:href="#marker" x="80" fill="#8888FF"/>
<use xlink:href="#marker" x="100" fill="orange"/>
<text font-family="embeded" font-size="20" x="20 40 60 80 100">1234</text>
</g>
<g id="xFewer" transform="translate(130, 160)">
<text text-anchor="end" x="-30">x fewer</text>
<use xlink:href="#marker" x="0" fill="orange"/>
<use xlink:href="#marker" x="20" fill="#8888FF"/>
<use xlink:href="#marker" x="40" fill="#8888FF"/>
<use xlink:href="#marker" x="60" fill="#8888FF"/>
<use xlink:href="#marker" x="75" fill="#8888FF"/>
<text font-family="embeded" font-size="20" x="20 40 60">1234</text>
</g>
<g id="yAll" transform="translate(130, 200)">
<text text-anchor="end" x="-30">y all</text>
<use xlink:href="#marker" x="0" y="-10" fill="#8888FF"/>
<use xlink:href="#marker" x="15" y="-5" fill="#8888FF"/>
<use xlink:href="#marker" x="30" y="5" fill="#8888FF"/>
<use xlink:href="#marker" x="45" y="10" fill="#8888FF"/>
<text font-family="embeded" font-size="20" y="-10 -5 5 10">1234</text>
</g>
<g id="yMore" transform="translate(130, 250)">
<text text-anchor="end" x="-30">y more</text>
<use xlink:href="#marker" x="0" y="-10" fill="#8888FF"/>
<use xlink:href="#marker" x="15" y="-5" fill="#8888FF"/>
<use xlink:href="#marker" x="30" y="5" fill="#8888FF"/>
<use xlink:href="#marker" x="45" y="10" fill="#8888FF"/>
<text font-family="embeded" font-size="20" y="-10 -5 5 10 20">1234</text>
</g>
<g id="yFewer" transform="translate(130, 300)">
<text text-anchor="end" x="-30">y fewer</text>
<use xlink:href="#marker" x="0" y="-10" fill="#8888FF"/>
<use xlink:href="#marker" x="15" y="-5" fill="#8888FF"/>
<use xlink:href="#marker" x="30" y="5" fill="#8888FF"/>
<use xlink:href="#marker" x="45" y="5" fill="#8888FF"/>
<text font-family="embeded" font-size="20" y="-10 -5 5">1234</text>
</g>
<g transform="translate(220, 0)">
<g id="xyAll" transform="translate(130, 80)">
<text text-anchor="end" x="-30">x/y all</text>
<use xlink:href="#marker" x="0" fill="orange"/>
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>
<use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>
<use xlink:href="#marker" x="80" y="10" fill="#8888FF"/>
<text font-family="embeded" font-size="20" x="20 40 60 80" y="-10 -5 5 10">1234</text>
</g>
<g id="xyMore" transform="translate(130, 120)">
<text text-anchor="end" x="-30">x/y more</text>
<use xlink:href="#marker" x="0" fill="orange"/>
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>
<use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>
<use xlink:href="#marker" x="80" y="10" fill="#8888FF"/>
<use xlink:href="#marker" x="100" y="20" fill="orange"/>
<text font-family="embeded" font-size="20" x="20 40 60 80 100" y="-10 -5 5 10 20">1234</text>
</g>
<g id="xyFewer" transform="translate(130, 160)">
<text text-anchor="end" x="-30">x/y fewer</text>
<use xlink:href="#marker" x="0" fill="orange"/>
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>
<use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>
<use xlink:href="#marker" x="75" y="5" fill="#8888FF"/>
<text font-family="embeded" font-size="20" x="20 40 60" y="-10 -5 5">1234</text>
</g>
<g id="xAllyFewer" transform="translate(130, 200)">
<text text-anchor="end" x="-30">x all y fewer</text>
<use xlink:href="#marker" x="0" fill="orange"/>
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>
<use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>
<use xlink:href="#marker" x="80" y="5" fill="#8888FF"/>
<text font-family="embeded" font-size="20" x="20 40 60 80" y="-10 -5 5">1234</text>
</g>
<g id="xFewerYall" transform="translate(130, 240)">
<text text-anchor="end" x="-30">x fewer y all</text>
<use xlink:href="#marker" x="0" fill="orange"/>
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF"/>
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF"/>
<use xlink:href="#marker" x="60" y="5" fill="#8888FF"/>
<use xlink:href="#marker" x="77.52" y="10" fill="#8888FF"/>
<text font-family="embeded" font-size="20" x="20 40 60" y="-10 -5 5 10">1234</text>
</g>
</g>
</g>
</g>
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.12 $</text>
</g>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
<!-- comment out this watermark once the test is approved -->
<!--<g id="draft-watermark">
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
</g>-->
</svg>
|