Revision control
Copy as Markdown
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.2" baseProfile="tiny" xml:id="svg-root" width="100%" height="100%"
<!--======================================================================-->
<!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, European Research Consortium for =-->
<!--= Informatics and Mathematics (ERCIM), Keio University). =-->
<!--= All Rights Reserved. =-->
<!--======================================================================-->
reviewer="VH" owner="LH," desc="Test that viewer correctly handle whitespace and the 'space' attribute." status="accepted"
approved="yes"
version="$Revision: 1.7 $" testname="$RCSfile: text-ws-01-t.svg,v $">
<d:OperatorScript xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" xmlns="http://www.w3.org/1999/xhtml">
<p>Test for viewer correct handling of whitespace and the 'xml:space' attribute. There are two sub-tests, for xml:space value "default". In each test, the content of the 'text' element is written on multiple lines. The first test of each pair has indented text with leading space characters, tabs, etc. The second has no indentation, but a line break before the content and after it. There are no space (or other whitespace) characters at the ends of the lines.</p>
<p>The two test cases are self-descriptive. From the top; first, "default" value applied to 3 lines of content with indents, space characters, tabs, etc; second, "default" applied to two lines content with no indent;</p>
<p>In each test, the test string is in blue and the reference image is in black. The rendered picture should approximately match the reference image, however there is some question in the reference image concerning the exact amount of space in the long-space areas. The third test uses the nbsp unicode character to force the reference white spaces display, which provides an accurate match if the font in use has the same metrics for that character and the default white space. Also, variations are possible in the text fonts and layout (per CSS2 rules).</p>
<p>The test also uses the 'rect' element, as well as basic fill (solid primary colors), stroke (black 1-pixel lines), font-family (Arial) and font-size properties.</p>
</d:OperatorScript>
</SVGTestCase>
<title xml:id="test-title">$RCSfile: text-ws-01-t.svg,v $</title>
<defs>
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
<font-face-src>
<font-face-uri xlink:href="../images/SVGFreeSans.svg#ascii" />
</font-face-src>
</font-face>
</defs>
<g xml:id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
<text x="15" y="35" font-size="32" fill="black">Basic: xml:space attribute</text>
<text x="35" y="60" font-size="32" fill="black">& whitespace handling.</text>
<!-- Test 1: indented, spaces, tabs, and space='default' -->
<!-- Features=" line break and spaces before 1st line" tabs before 2nd line; -->
<!-- spaces before 3rd line; no space at ends of any lines. -->
<text x="15" y="105" fill="blue" font-size="40" xml:space="default">WS with indented lines.</text>
<text x="15" y="140" fill="black" font-size="40">WS with indented lines.</text>
<rect x="25" y="145" width="350" height="36" fill="none" stroke="black" />
<text x="28" y="175" fill="black" font-size="40">xml:space='default'</text>
<!-- Test 2: non-indented,and space='default' -->
<!-- Features=" line break before 1st line" no space either at beginning -->
<!-- or end of any lines. -->
<text x="15" y="225" fill="blue" font-size="40" xml:space="default"> WS non-indented lines. </text>
<text x="15" y="260" fill="black" font-size="40">WS non-indented lines.</text>
<rect x="25" y="265" width="350" height="36" fill="none" stroke="black" />
<text x="28" y="295" fill="black" font-size="40">xml:space='default'</text>
</g>
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
<text xml:id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.7 $</text>
</g>
<rect xml:id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000" />
<!-- comment out this watermark once the test is approved -->
<!--<g xml:id="draft-watermark">
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1" />
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
</g>-->
</svg>