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