| 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="SVGWG" author="Lofton Henderson" status="issue" |
| 15 |
version="$Revision: 1.8 $" testname="$RCSfile: text-ws-01-t.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/text.html#WhiteSpace"> |
| 17 |
<!-- RESOLUTION 2011-03-04 deprecate xml;space in favour of CSS whitespace property, for SVG2 --> |
| 18 |
<p> |
| 19 |
Test for viewer correct handling of whitespace and the 'xml:space' attribute. |
| 20 |
There are two sub-tests, for xml:space value "default". |
| 21 |
In each test, the content of the 'text' element is written on |
| 22 |
multiple lines. The first test of each pair has indented text with leading |
| 23 |
space characters, tabs, etc. The second has no indentation, but a line break |
| 24 |
before the content and after it. There are no space (or other whitespace) |
| 25 |
characters at the ends of the lines. |
| 26 |
</p> |
| 27 |
<p> |
| 28 |
The two test cases are self-descriptive. From the top; |
| 29 |
first, "default" value applied to 3 lines of content with indents, space characters, tabs, etc; |
| 30 |
second, "default" applied to two lines content with no indent; |
| 31 |
</p> |
| 32 |
</d:testDescription> |
| 33 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 34 |
<p> |
| 35 |
Run the test. No interaction required. |
| 36 |
</p> |
| 37 |
</d:operatorScript> |
| 38 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 39 |
<p> |
| 40 |
In each test, the test string is in blue and the reference |
| 41 |
image is in black. |
| 42 |
The rendered picture should approximately match the reference image, |
| 43 |
however there is some question in the reference image concerning the |
| 44 |
exact amount of space in the long-space areas. The third test uses the nbsp unicode character |
| 45 |
to force the reference white spaces display, which provides an accurate match if the font in use |
| 46 |
has the same metrics for that character and the default white space. |
| 47 |
Also, variations are possible in the text fonts and layout (per CSS2 rules). |
| 48 |
</p> |
| 49 |
<p> |
| 50 |
The test also uses the 'rect' element, |
| 51 |
as well as basic fill (solid primary colors), |
| 52 |
stroke (black 1-pixel lines), font-family (Arial) |
| 53 |
and font-size properties. |
| 54 |
</p> |
| 55 |
</d:passCriteria> |
| 56 |
</d:SVGTestCase> |
| 57 |
<title id="test-title">$RCSfile: text-ws-01-t.svg,v $</title> |
| 58 |
<defs> |
| 59 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 60 |
<font-face-src> |
| 61 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 62 |
</font-face-src> |
| 63 |
</font-face> |
| 64 |
</defs> |
| 65 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 66 |
<text x="15" y="35" font-size="32" fill="black">Basic: xml:space attribute</text> |
| 67 |
<text x="35" y="60" font-size="32" fill="black">& whitespace handling.</text> |
| 68 |
<!-- Test 1: indented, spaces, tabs, and space='default' --> |
| 69 |
<!-- Features=" line break and spaces before 1st line" tabs before 2nd line; --> |
| 70 |
<!-- spaces before 3rd line; no space at ends of any lines. --> |
| 71 |
<text x="15" y="105" fill="blue" font-size="40" xml:space="default">WS with indented lines.</text> |
| 72 |
<text x="15" y="140" fill="black" font-size="40">WS with indented lines.</text> |
| 73 |
<rect x="25" y="145" width="350" height="36" fill="none" stroke="black"/> |
| 74 |
<text x="28" y="175" fill="black" font-size="40">xml:space='default'</text> |
| 75 |
<!-- Test 2: non-indented,and space='default' --> |
| 76 |
<!-- Features=" line break before 1st line" no space either at beginning --> |
| 77 |
<!-- or end of any lines. --> |
| 78 |
<text x="15" y="225" fill="blue" font-size="40" xml:space="default"> |
| 79 |
WS |
| 80 |
non-indented lines. |
| 81 |
</text> |
| 82 |
<text x="15" y="260" fill="black" font-size="40">WS non-indented lines.</text> |
| 83 |
<rect x="25" y="265" width="350" height="36" fill="none" stroke="black"/> |
| 84 |
<text x="28" y="295" fill="black" font-size="40">xml:space='default'</text> |
| 85 |
</g> |
| 86 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 87 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.8 $</text> |
| 88 |
</g> |
| 89 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 90 |
<!-- comment out this watermark once the test is approved --> |
| 91 |
<g id="draft-watermark"> |
| 92 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 93 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 94 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 95 |
</g> |
| 96 |
</svg> |