OLD | NEW |
| (Empty) |
1 <?xml version="1.0" encoding="UTF-8"?> | |
2 <!--======================================================================--> | |
3 <!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =--> | |
4 <!--= Institute of Technology, Institut National de Recherche en =--> | |
5 <!--= Informatique et en Automatique, Keio University). All Rights =--> | |
6 <!--= Reserved. See http://www.w3.org/Consortium/Legal/. =--> | |
7 <!--======================================================================--> | |
8 <!-- =====================================================================--> | |
9 <!-- --> | |
10 <!-- font-hkern-01-t.svg --> | |
11 <!-- --> | |
12 <!-- Test handling of hkern elements in SVG Fonts --> | |
13 <!-- Author : Vincent Hardy, 06-Jan-2004 --><!D
OCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG
/1.1/DTD/svg11-tiny.dtd"> | |
14 | |
15 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin
k" version="1.1" baseProfile="tiny" id="svg-root" width="100%" height="100%" vie
wBox="0 0 480 360"> | |
16 <SVGTestCase xmlns:testcase="http://www.w3.org/2000/02/svg/testsuite/descrip
tion/" xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" owner="VH" r
eviewer="CN" desc="Test handling of hkern elements in SVG Fonts" status=
"accepted" version="$Revision: 1.9 $" testname="$RCSfile: fonts-kern-01-t.svg,v
$"> | |
17 <OperatorScript> | |
18 <Paragraph> | |
19 This test validates handling of the hkern element. | |
20 </Paragraph> | |
21 <Paragraph> | |
22 In all instances, a text element matching a font with hkern | |
23 is displayed along with reference markers showing the expected | |
24 glyph positioning. | |
25 </Paragraph> | |
26 | |
27 <Paragraph> | |
28 The 'fontA' cell shows the string "12" with "fontA" for which th
ere | |
29 in a kerning pair defined with u1="1" and u2="2". | |
30 </Paragraph> | |
31 | |
32 <Paragraph> | |
33 The 'fontB' cell shows the string "12" with "fontB" for which th
ere | |
34 in a kerning pair defined with g1="gl_1" and g2="gl_2", | |
35 where "gl_1" has unicode="1" and "gl_2" has unicode="2". | |
36 </Paragraph> | |
37 | |
38 <Paragraph> | |
39 The 'fontC' cell shows the string "1234" with "fontC" were the s
ame kerning pair | |
40 uses u1/u2 to match "12" and g1/g2 to match "34". | |
41 </Paragraph> | |
42 | |
43 <Paragraph> | |
44 The 'fontD' cell shows the string "1234" with "fontD" were the s
ame kerning pair | |
45 uses u1/u2 to match "12" and "34" (u1/u2 are lists of character
vales). | |
46 </Paragraph> | |
47 | |
48 <Paragraph> | |
49 The 'fontE' cell shows the string "1234" with "fontE" were the s
ame kerning pair | |
50 uses g1/g2 to match "12" and "34" (g1/g2 are lists of names). | |
51 </Paragraph> | |
52 | |
53 <Paragraph> | |
54 The 'fontF' cell shows the string "1234" with "fontF" were the s
ame kerning pair | |
55 uses u1/u2 to match "12" and "34" (u1/u2 are unicode ranges). | |
56 </Paragraph> | |
57 | |
58 <Paragraph> | |
59 The 'fontG' cell shows the string "12" with "fontG" were for whi
ch there | |
60 is a kerning pair with u1 matching "1" and g2 matching "gl_2". | |
61 </Paragraph> | |
62 | |
63 | |
64 </OperatorScript> | |
65 </SVGTestCase> | |
66 <g id="test-body-content"> | |
67 <defs> | |
68 <g id="marker"> | |
69 <!-- <rect x="0" y="-10" width="10" height="10" /> --> | |
70 <line y2="-12" stroke="red" stroke-width="1"/> | |
71 <line x2="12" stroke="red" stroke-width="1"/> | |
72 <rect x="-2" y="-2" width="4" height="4" fill="red"/> | |
73 </g> | |
74 | |
75 <g id="sampleBkg"> | |
76 <rect width="200" height="20" fill="#eeeeee"/> | |
77 <rect y="20" width="200" height="30" fill="#cccccc"/> | |
78 <rect width="200" height="50" fill="none" stroke="black"/> | |
79 </g> | |
80 | |
81 </defs> | |
82 | |
83 <text x="240" y="30" font-size="20" text-anchor="middle"><hkern></
text> | |
84 <g id="legend" transform="translate(30, 60)"> | |
85 <g> | |
86 <g> | |
87 <rect x="-20" width="20" height="50" fill="none" stroke="bla
ck"/> | |
88 <text transform="translate(-5, 25) rotate(-90)" text-anchor=
"middle">font A</text> | |
89 </g> | |
90 <use xlink:href="#sampleBkg"/> | |
91 <text x="5" y="15" font-size="12">u1="1" u2="2"</text> | |
92 <g transform="translate(5, 45) scale(2)" font-size="10"> | |
93 <!-- Advance for '1': 0 --> | |
94 <use xlink:href="#marker" fill="#8888ff"/> | |
95 | |
96 <!-- Advance for '2' : '1'.advance + kerning --> | |
97 <!-- : ((250 - (-1000))/1000)*10 --> | |
98 <!-- : 12.5 --> | |
99 <use xlink:href="#marker" x="12.5" fill="#8888ff"/> | |
100 <text font-family="fontA" font-size="10">12</text> | |
101 </g> | |
102 </g> | |
103 | |
104 <g transform="translate(0, 55)"> | |
105 <g> | |
106 <rect x="-20" width="20" height="50" fill="none" stroke="bla
ck"/> | |
107 <text transform="translate(-5, 25) rotate(-90)" text-anchor=
"middle">font B</text> | |
108 </g> | |
109 <use xlink:href="#sampleBkg"/> | |
110 <text x="5" y="15">g1="gl_1" g2="gl_2"</text> | |
111 <g transform="translate(5, 45) scale(2)"> | |
112 <use xlink:href="#marker" fill="#8888ff"/> | |
113 <use xlink:href="#marker" x="22.5" fill="#8888ff"/> | |
114 <text font-family="fontB" font-size="10">12</text> | |
115 </g> | |
116 </g> | |
117 | |
118 <g transform="translate(0, 110)"> | |
119 <g> | |
120 <rect x="-20" width="20" height="50" fill="none" stroke="bla
ck"/> | |
121 <text transform="translate(-5, 25) rotate(-90)" text-anchor=
"middle">font C</text> | |
122 </g> | |
123 <use xlink:href="#sampleBkg"/> | |
124 <text x="5" y="15">u1="1" u2="2" g1="gl_3" g2="gl_4"</text> | |
125 <g transform="translate(5, 45) scale(2)"> | |
126 <use xlink:href="#marker" fill="#8888ff"/> | |
127 <!-- ((1.adv + '12'.k)/unitsPerEm)*fontSize --> | |
128 <use xlink:href="#marker" x="17.5" fill="#8888ff"/> | |
129 <use xlink:href="#marker" x="32.5" fill="#8888ff"/> | |
130 <!-- ((3.adv + '34'.k)/unitsPerEm)*fontSize --> | |
131 <use xlink:href="#marker" x="55" fill="#8888ff"/> | |
132 <text font-family="fontC" font-size="10">1234</text> | |
133 </g> | |
134 </g> | |
135 | |
136 <g transform="translate(0, 165)"> | |
137 <g> | |
138 <rect x="-20" width="20" height="50" fill="none" stroke="bla
ck"/> | |
139 <text transform="translate(-5, 25) rotate(-90)" text-anchor=
"middle">font D</text> | |
140 </g> | |
141 <use xlink:href="#sampleBkg"/> | |
142 <text x="5" y="15">u1="1,3" u2="2,4"</text> | |
143 <g transform="translate(5, 45) scale(2)"> | |
144 <use xlink:href="#marker" fill="#8888ff"/> | |
145 <use xlink:href="#marker" x="17.5" fill="#8888ff"/> | |
146 <use xlink:href="#marker" x="32.5" fill="#8888ff"/> | |
147 <use xlink:href="#marker" x="55" fill="#8888ff"/> | |
148 <text font-family="fontD" font-size="10">1234</text> | |
149 </g> | |
150 </g> | |
151 | |
152 <g transform="translate(240, 0)"> | |
153 <g> | |
154 <rect x="-20" width="20" height="50" fill="none" stroke="bla
ck"/> | |
155 <text transform="translate(-5, 25) rotate(-90)" text-anchor=
"middle">font E</text> | |
156 </g> | |
157 <use xlink:href="#sampleBkg"/> | |
158 <text x="5" y="15">g1="gl_1,gl_3" g2="gl_2,gl_4"</text> | |
159 <g transform="translate(5, 45) scale(2)"> | |
160 <use xlink:href="#marker" fill="#8888ff"/> | |
161 <use xlink:href="#marker" x="17.5" fill="#8888ff"/> | |
162 <use xlink:href="#marker" x="32.5" fill="#8888ff"/> | |
163 <use xlink:href="#marker" x="55" fill="#8888ff"/> | |
164 <text font-family="fontE" font-size="10">1234</text> | |
165 </g> | |
166 </g> | |
167 | |
168 <g transform="translate(240, 55)"> | |
169 <g> | |
170 <rect x="-20" width="20" height="50" fill="none" stroke="bla
ck"/> | |
171 <text transform="translate(-5, 25) rotate(-90)" text-anchor=
"middle">font F</text> | |
172 </g> | |
173 <use xlink:href="#sampleBkg"/> | |
174 <text x="5" y="15">u1="U+003?" u2="U+0031-34"</text> | |
175 <g transform="translate(5, 45) scale(2)"> | |
176 <use xlink:href="#marker" fill="#8888ff"/> | |
177 <!-- '2' --> | |
178 <use xlink:href="#marker" x="17.5" fill="#8888ff"/> | |
179 <!-- '3' --> | |
180 <use xlink:href="#marker" x="47.5" fill="#8888ff"/> | |
181 <!-- '4' --> | |
182 <use xlink:href="#marker" x="70" fill="#8888ff"/> | |
183 <text font-family="fontF" font-size="10">1234</text> | |
184 </g> | |
185 </g> | |
186 | |
187 <g transform="translate(240, 110)"> | |
188 <g> | |
189 <rect x="-20" width="20" height="50" fill="none" stroke="bla
ck"/> | |
190 <text transform="translate(-5, 25) rotate(-90)" text-anchor=
"middle">font G</text> | |
191 </g> | |
192 <use xlink:href="#sampleBkg"/> | |
193 <text x="5" y="15">u1="1" g2="gl_2"</text> | |
194 <g transform="translate(5, 45) scale(2)"> | |
195 <!-- Advance for '1': 0 --> | |
196 <use xlink:href="#marker" fill="#8888ff"/> | |
197 | |
198 <!-- Advance for '2' : '1'.advance + kerning --> | |
199 <!-- : ((250 - (-1000))/1000)*10 --> | |
200 <!-- : 12.5 --> | |
201 <use xlink:href="#marker" x="12.5" fill="#8888ff"/> | |
202 <text font-family="fontG" font-size="10">12</text> | |
203 </g> | |
204 </g> | |
205 </g> | |
206 | |
207 <g id="testContent" transform="translate(320, 100)" font-size="10"> | |
208 | |
209 | |
210 | |
211 | |
212 </g> | |
213 </g> | |
214 | |
215 <defs> | |
216 | |
217 <font horiz-adv-x="224"> | |
218 <font-face font-family="fontG" units-per-em="1000" ascent="917" descent="-250"/> | |
219 <missing-glyph horiz-adv-x="800" d="M 0 0 L 750 0 L 750 1000 L 0 1000 Z"
/> | |
220 <glyph unicode="1" glyph-name="gl_1" horiz-adv-x="250" d="M 0 0 L 250 0
L 250 250 L 0 250 Z"/> | |
221 <glyph unicode="2" glyph-name="gl_2" horiz-adv-x="1500" d="M 0 0 L 500 0
L 500 500 L 0 500 Z"/> | |
222 <hkern u1="1" g2="gl_2" k="-1000"/> | |
223 </font> | |
224 | |
225 <font horiz-adv-x="224"> | |
226 <font-face font-family="fontF" units-per-em="1000" ascent="917" descent="-250"/> | |
227 <missing-glyph horiz-adv-x="800" d="M 0 0 L 750 0 L 750 1000 L 0 1000 Z"
/> | |
228 <glyph unicode="1" glyph-name="gl_1" horiz-adv-x="250" d="M 0 0 L 250 0
L 250 250 L 0 250 Z"/> | |
229 <glyph unicode="2" glyph-name="gl_2" horiz-adv-x="1500" d="M 0 0 L 500 0
L 500 500 L 0 500 Z"/> | |
230 <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"/> | |
231 <glyph unicode="4" glyph-name="gl_4" horiz-adv-x="1000" d="M 0 0 L 1000
0 L 1000 1000 L 0 1000 Z"/> | |
232 <!-- u1 covers '0' to '9' and ':' ';' '<' '=' '>' '?' --> | |
233 <!-- u2 covers '1' '2' '3' and '4' --> | |
234 <!-- So, this is a match for '12', '23' and '34' --> | |
235 <hkern u1="U+003?" u2="U+0031-0034" k="-1500"/> | |
236 </font> | |
237 | |
238 <font horiz-adv-x="224"> | |
239 <font-face font-family="fontE" units-per-em="1000" ascent="917" descent="-250"/> | |
240 <missing-glyph horiz-adv-x="800" d="M 0 0 L 750 0 L 750 1000 L 0 1000 Z"
/> | |
241 <glyph unicode="1" glyph-name="gl_1" horiz-adv-x="250" d="M 0 0 L 250 0
L 250 250 L 0 250 Z"/> | |
242 <glyph unicode="2" glyph-name="gl_2" horiz-adv-x="1500" d="M 0 0 L 500 0
L 500 500 L 0 500 Z"/> | |
243 <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"/> | |
244 <glyph unicode="4" glyph-name="gl_4" horiz-adv-x="1000" d="M 0 0 L 1000
0 L 1000 1000 L 0 1000 Z"/> | |
245 <hkern g1="gl_1,gl_3" g2="gl_2,gl_4" k="-1500"/> | |
246 </font> | |
247 | |
248 <font horiz-adv-x="224"> | |
249 <font-face font-family="fontD" units-per-em="1000" ascent="917" descent="-250"/> | |
250 <missing-glyph horiz-adv-x="800" d="M 0 0 L 750 0 L 750 1000 L 0 1000 Z"
/> | |
251 <glyph unicode="1" glyph-name="gl_1" horiz-adv-x="250" d="M 0 0 L 250 0
L 250 250 L 0 250 Z"/> | |
252 <glyph unicode="2" glyph-name="gl_2" horiz-adv-x="1500" d="M 0 0 L 500 0
L 500 500 L 0 500 Z"/> | |
253 <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"/> | |
254 <glyph unicode="4" glyph-name="gl_4" horiz-adv-x="1000" d="M 0 0 L 1000
0 L 1000 1000 L 0 1000 Z"/> | |
255 <hkern u1="1,3" u2="2,4" k="-1500"/> | |
256 </font> | |
257 | |
258 <font horiz-adv-x="224"> | |
259 <font-face font-family="fontC" units-per-em="1000" ascent="917" descent="-250"/> | |
260 <missing-glyph horiz-adv-x="800" d="M 0 0 L 750 0 L 750 1000 L 0 1000 Z"
/> | |
261 <glyph unicode="1" glyph-name="gl_1" horiz-adv-x="250" d="M 0 0 L 250 0
L 250 250 L 0 250 Z"/> | |
262 <glyph unicode="2" glyph-name="gl_2" horiz-adv-x="1500" d="M 0 0 L 500 0
L 500 500 L 0 500 Z"/> | |
263 <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"/> | |
264 <glyph unicode="4" glyph-name="gl_4" horiz-adv-x="1000" d="M 0 0 L 1000
0 L 1000 1000 L 0 1000 Z"/> | |
265 | |
266 <hkern u1="1" u2="2" g1="gl_3" g2="gl_4" k="-1500"/> | |
267 </font> | |
268 | |
269 <font horiz-adv-x="224"> | |
270 <font-face font-family="fontB" units-per-em="1000" ascent="917" descent="-250"/> | |
271 <missing-glyph horiz-adv-x="800" d="M 0 0 L 750 0 L 750 1000 L 0 1000 Z"
/> | |
272 <glyph unicode="1" glyph-name="gl_1" horiz-adv-x="250" d="M 0 0 L 250 0
L 250 250 L 0 250 Z"/> | |
273 <glyph unicode="2" glyph-name="gl_2" horiz-adv-x="500" d="M 0 0 L 500 0
L 500 500 L 0 500 Z"/> | |
274 <hkern g1="gl_1" g2="gl_2" k="-2000"/> | |
275 </font> | |
276 | |
277 <font horiz-adv-x="224"> | |
278 <font-face font-family="fontA" units-per-em="1000" ascent="917" descent="-250"/> | |
279 <missing-glyph horiz-adv-x="800" d="M 0 0 L 750 0 L 750 1000 L 0 1000 Z"
/> | |
280 <glyph unicode="1" glyph-name="gl_1" horiz-adv-x="250" d="M 0 0 L 250 0
L 250 250 L 0 250 Z"/> | |
281 <glyph unicode="2" glyph-name="gl_2" horiz-adv-x="500" d="M 0 0 L 500 0
L 500 500 L 0 500 Z"/> | |
282 <hkern u1="1" u2="2" k="-1000"/> | |
283 </font> | |
284 | |
285 </defs> | |
286 | |
287 <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$
Revision: 1.9 $</text> | |
288 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke=
"#000000"/> | |
289 | |
290 </svg> | |
OLD | NEW |