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