OLD | NEW |
| (Empty) |
1 <?xml version="1.0" encoding="UTF-8"?> | |
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics
/SVG/1.1/DTD/svg11-basic.dtd"> | |
3 <!--======================================================================--> | |
4 <!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =--> | |
5 <!--= Institute of Technology, Institut National de Recherche en =--> | |
6 <!--= Informatique et en Automatique, Keio University). All Rights =--> | |
7 <!--= Reserved. See http://www.w3.org/Consortium/Legal/. =--> | |
8 <!--======================================================================--> | |
9 <!-- ===================================================================== --> | |
10 <!-- --> | |
11 <!-- text-textLength-BE-17-patch.svg --> | |
12 <!-- renamed for 1.1 suite to text-text-01-b.svg
--> | |
13 <!-- --> | |
14 <!-- Basic test of 'textLength' and 'lengthAdjust' attributes. --> | |
15 <!-- --> | |
16 <!-- Author : Lofton Henderson, 29-aug-2000. --> | |
17 <!-- 1.1 revision by Rick Graham --> | |
18 <!-- Revised for SVGT/B : Mathias Larsson Carlander Aug/20/2002 --
> | |
19 <!-- --> | |
20 <!-- History: --> | |
21 <!-- 29-aug-2000, LH: Serial#1 created. --> | |
22 <!-- --> | |
23 <!-- ===================================================================== --> | |
24 <!--======================================================================--> | |
25 <!--= Note. After October 2000, revision history is kept as CVS 'commit' =--> | |
26 <!--= log messages, and therefore is no longer in the preceding preamble.=--> | |
27 <!--======================================================================--> | |
28 <svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:
xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" vi
ewBox="0 0 160 120"> | |
29 <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/
"> | |
30 <OperatorScript version="$Revision: 1.7 $" testname="text-text-0
1-b.svg"> | |
31 <Paragraph> | |
32 Test viewer capibility to handle basic use of 't
extLength' | |
33 and 'lengthAdjust' attributes. | |
34 </Paragraph> | |
35 <Paragraph> | |
36 There are four pairs of sub-tests. Each pair of
sub-tests consists | |
37 of the same two strings: "Line to Stretch" on t
he left, and "this is | |
38 a line to squeeze" on the right. | |
39 </Paragraph> | |
40 <Paragraph> | |
41 The first (topmost) pair contains no occurrences
of the textLength and | |
42 lengthAdjust attributes in the 'text' elements.
| |
43 The red reference line under each of the top | |
44 two strings indicates the approximate length of
the strings. Since | |
45 the lengths are not constrained by the 'textLeng
th' attribute, small | |
46 variations of the lengths are permissible. | |
47 </Paragraph> | |
48 <Paragraph> | |
49 The remaining three pairs each applies 'textLeng
th' attributes to the | |
50 strings. In the leftmost sub-test of each pair,
the 'textLength' value | |
51 will cause a stretching of the string of approxi
mately 25% over the | |
52 "normal" length. In the rightmost sub-test of e
ach pair, the 'textLength' value | |
53 will cause a squeezing of the string of approxim
ately 20% under the | |
54 "normal" length for the string. | |
55 </Paragraph> | |
56 <Paragraph> | |
57 In each of the sub-tests with an application of
'textLength', the | |
58 red reference lines indicate the exact extent of
the rendered text. | |
59 The rendered text should fit snugly just within
the ticks at the end of | |
60 the red lines. | |
61 </Paragraph> | |
62 <Paragraph> | |
63 The second pair from the top contains 'textLengt
h' but no 'lengthAdjust' | |
64 attributes. In this case, the effect should be
as if the value "spacing" | |
65 were specified. Only the inter-character advanc
ement and inter-word spacing | |
66 should change. The aspect ratio of the glyphs s
hould be unaffected. The | |
67 reference image illustrates one valid way to ach
ieve this, by a | |
68 uniform increase or decrease of inter-character
advancement. | |
69 </Paragraph> | |
70 <Paragraph> | |
71 The third pair from the top explicitly sets 'len
gthAdjust' value | |
72 to "spacing". Therefore it should be rendered i
dentically to the second pair. | |
73 </Paragraph> | |
74 <Paragraph> | |
75 The fourth (bottommost) sub-test pair explicitly
sets 'lengthAdjust' value | |
76 to "spacingAndGlyphs". The advancements between
characters and words, as well as | |
77 the glyph aspect ratios should be affected. | |
78 The reference image illustrates one valid way to
achieve | |
79 this, by a uniform expansion or compression of t
he string as a whole. | |
80 This effect is equivalent to application of a "s
cale(xfactor, 1.0)" transformation | |
81 to the 'text' elements. | |
82 </Paragraph> | |
83 <Paragraph> | |
84 The rendered picture should match the reference
image, except as noted above. | |
85 In particular, the 'textLength' constraint must
be satisfied precisely, | |
86 and the basic rules associated with the "spacing
" and "spacingAndGlyphs" values | |
87 of 'lengthAdjust' must be met, but the precise a
lgorithm for meeting all | |
88 of the required contraints is otherwise unspecif
ied. | |
89 </Paragraph> | |
90 <Paragraph> | |
91 The test also uses the 'transform' attribute, th
e 'rect' element, | |
92 as well as basic fill (solid primary colors), | |
93 stroke (black 1-pixel lines), font-family (Arial
) | |
94 and font-size properties. | |
95 </Paragraph> | |
96 </OperatorScript> | |
97 </SVGTestCase> | |
98 <title id="test-title">text-text-01-b.svg</title> | |
99 <desc id="test-desc">Basic test of 'textLength' and 'lengthAdjust' attri
butes.</desc> | |
100 <!--====================================================================
==--> | |
101 <!--Content of Test Case follows... ===================
==--> | |
102 <!--====================================================================
==--> | |
103 <g id="test-body-content"> | |
104 <text x="14" y="10" font-family="Arial" font-size="10" fill="bla
ck">Basic test of 'textLength' </text> | |
105 <text x="10" y="20" font-family="Arial" font-size="10" fill="bla
ck">and 'lengthAdjust' attributes.</text> | |
106 <!-- Test cases 1&2: all defaults --> | |
107 <g id="test-1-2"> | |
108 <!-- The text lines --> | |
109 <g font-family="Arial" font-size="8" fill="blue"> | |
110 <text x="3" y="30">Line to Stretch</text> | |
111 <text x="75" y="30">this is a line to squeeze</t
ext> | |
112 </g> | |
113 <!-- Length reference lines --> | |
114 <!-- (half ticks here only, as these lengths can validly
vary slightly) --> | |
115 <g stroke="red"> | |
116 <line x1="2" y1="32" x2="56" y2="32"/> | |
117 <!-- <line x1="39" y1="70" x2="39" y2="84"
/> --> | |
118 <line x1="2" y1="32" x2="2" y2="36"/> | |
119 <!-- <line x1="145" y1="70" x2="145" y2="84
" /> --> | |
120 <line x1="56" y1="32" x2="56" y2="36"/> | |
121 <line x1="74" y1="32" x2="158" y2="32"/> | |
122 <!-- <line x1="244" y1="70" x2="244" y2="84
" /> --> | |
123 <line x1="74" y1="32" x2="74" y2="36"/> | |
124 <!-- <line x1="412" y1="70" x2="412" y2="84
" /> --> | |
125 <line x1="158" y1="32" x2="158" y2="36"/> | |
126 </g> | |
127 <!-- Labels --> | |
128 <g font-family="Arial" font-size="6" fill="black"> | |
129 <text x="6" y="38">textLength: default</text> | |
130 <text x="6" y="44">lengthAdjust: default</text> | |
131 <text x="76" y="38">textLength: default</text> | |
132 <text x="76" y="44">lengthAdjust: default</text> | |
133 </g> | |
134 </g> | |
135 <!-- Test cases 3&4: define textLength, default lengthAdjust--> | |
136 <g id="test-3-4" transform="translate(0,22)"> | |
137 <!-- The text lines --> | |
138 <g font-family="Arial" font-size="8" fill="blue"> | |
139 <text x="3" y="30" textLength="65">Line to Stret
ch</text> | |
140 <text x="75" y="30" textLength="65">this is a li
ne to squeeze</text> | |
141 </g> | |
142 <!-- Length reference lines --> | |
143 <g stroke="red"> | |
144 <line x1="2" y1="32" x2="69" y2="32"/> | |
145 <line x1="2" y1="32" x2="2" y2="36"/> | |
146 <line x1="69" y1="32" x2="69" y2="36"/> | |
147 <line x1="74" y1="32" x2="141" y2="32"/> | |
148 <line x1="74" y1="32" x2="74" y2="36"/> | |
149 <line x1="141" y1="32" x2="141" y2="36"/> | |
150 </g> | |
151 <!-- Labels --> | |
152 <g font-family="Arial" font-size="6" fill="black"> | |
153 <text x="6" y="38">textLength: 25% longer</text> | |
154 <text x="6" y="44">lengthAdjust: default</text> | |
155 <text x="76" y="38">textLength: 15% shorter</tex
t> | |
156 <text x="76" y="44">lengthAdjust: default</text> | |
157 </g> | |
158 </g> | |
159 <!-- Test cases 5&6: define textLength, lengthAdjust=spacing --> | |
160 <g id="test-5-6" transform="translate(0,44)"> | |
161 <!-- The text lines --> | |
162 <g font-family="Arial" font-size="8" fill="blue"> | |
163 <text x="3" y="30" textLength="65" lengthAdjust=
"spacing">Line to Stretch</text> | |
164 <text x="75" y="30" textLength="65" lengthAdjust
="spacing">this is a line to squeeze</text> | |
165 </g> | |
166 <!-- Length reference lines --> | |
167 <g stroke="red"> | |
168 <line x1="2" y1="32" x2="69" y2="32"/> | |
169 <line x1="2" y1="32" x2="2" y2="36"/> | |
170 <line x1="69" y1="32" x2="69" y2="36"/> | |
171 <line x1="74" y1="32" x2="141" y2="32"/> | |
172 <line x1="74" y1="32" x2="74" y2="36"/> | |
173 <line x1="141" y1="32" x2="141" y2="36"/> | |
174 </g> | |
175 <!-- Labels --> | |
176 <g font-family="Arial" font-size="6" fill="black"> | |
177 <text x="3" y="38">textLength: 25% longer</text> | |
178 <text x="3" y="44">lengthAdjust: spacing</text> | |
179 <text x="76" y="38">textLength: 15% shorter</tex
t> | |
180 <text x="76" y="44">lengthAdjust: spacing</text> | |
181 </g> | |
182 </g> | |
183 <!-- Test cases 7&8: define textLength, lengthAdjust=spacingAndG
lyphs --> | |
184 <g id="test-7-8" transform="translate(0,66)"> | |
185 <!-- The text lines --> | |
186 <g font-family="Arial" font-size="8" fill="blue"> | |
187 <text x="3" y="30" textLength="65" lengthAdjust=
"spacingAndGlyphs">Line to Stretch</text> | |
188 <text x="75" y="30" textLength="65" lengthAdjust
="spacingAndGlyphs">this is a line to squeeze</text> | |
189 </g> | |
190 <!-- Length reference lines --> | |
191 <g stroke="red"> | |
192 <line x1="2" y1="32" x2="69" y2="32"/> | |
193 <line x1="2" y1="32" x2="2" y2="36"/> | |
194 <line x1="69" y1="32" x2="69" y2="36"/> | |
195 <line x1="74" y1="32" x2="141" y2="32"/> | |
196 <line x1="74" y1="32" x2="74" y2="36"/> | |
197 <line x1="141" y1="32" x2="141" y2="36"/> | |
198 </g> | |
199 <!-- Labels --> | |
200 <g font-family="Arial" font-size="6" fill="black"> | |
201 <text x="6" y="38">textLength: 25% longer</text> | |
202 <text x="6" y="44">lengthAdjust: sAG</text> | |
203 <text x="76" y="38">textLength: 20% shorter</tex
t> | |
204 <text x="76" y="44">lengthAdjust: sAG</text> | |
205 </g> | |
206 </g> | |
207 </g> | |
208 <text id="revision" x="5" y="117" font-size="8" stroke="none" fill="black">$Revi
sion: 1.7 $</text> | |
209 <rect id="test-frame" x="1" y="1" width="158" height="118" fill="none" s
troke="#000000"/> | |
210 <script> | |
211 if (window.testRunner) | |
212 window.testRunner.dumpSelectionRect(); | |
213 document.execCommand("SelectAll"); | |
214 </script> | |
215 </svg> | |
OLD | NEW |