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="AE" owner="VH" desc="Tests that the viewer can handle the rotate attribute on the text element" status="accepted"
approved="yes"
version="$Revision: 1.6 $" testname="$RCSfile: text-text-04-t.svg,v $">
<d:OperatorScript xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" xmlns="http://www.w3.org/1999/xhtml">
<p>The purpose of this test is to validate proper handling of the text element's x and y attributes. In the various samples, a red marker shows the text's (0,0) coordinate. The blue markers show the current text positions. These are either defined by absolute x/y positioning or they are computed from the embeded font's glyphs advances.</p>
<p>The first text sample shows a reference piece of text.</p>
<p>The second text sample (x all) shows a piece of text where all the glyphs are positioned along the x axis.</p>
<p>The third text sample (x more) is a text element where there are more x values than characters (5 values for 4 characters). The last x value should be ignored and the result should be the same as the third sample.</p>
<p>The fourth text sample (x fewer) is a text element where there are fewer x values than characters (3 values for 4 characters). The last character should not be positioned but laid out normally, following its previous character sibling.</p>
<p>The fifth (y all), sixth (y more) and seventh (y fewer) text sample parallel the second, third and fourth test, but for the y attribute values.</p>
<p>The samples in the right column show combinations of x/y value sets.</p>
<p>In all the above tests, blue markers represent the expected glyph positions. The red markers are showing positions where no glyph should appear. The glyphs are black squares of increasing sizes.</p>
</d:OperatorScript>
</SVGTestCase>
<title xml:id="test-title">$RCSfile: text-text-04-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">
<defs>
<font xml:id="embeded" horiz-adv-x="224">
<font-face font-family="embeded" units-per-em="1000" ascent="1000" descent="-250" alphabetic="0" />
<missing-glyph horiz-adv-x="800" d="M50 0V800H750V0H50ZM700 50V750H100V50H700Z" />
<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" />
<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" />
<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" />
<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" />
</font>
</defs>
<defs>
<rect xml:id="marker" x="-4" y="-4" width="8" height="8" />
</defs>
<g font-size="16">
<g xml:id="reference" transform="translate(130, 40)">
<text text-anchor="end" x="-30">Reference</text>
<g>
<use xlink:href="#marker" x="0" fill="#8888FF" />
<use xlink:href="#marker" x="15" fill="#8888FF" />
<use xlink:href="#marker" x="30" fill="#8888FF" />
<use xlink:href="#marker" x="45" fill="#8888FF" />
<text xml:id="ref" font-family="embeded" font-size="20">1234</text>
</g>
</g>
<g xml:id="xAll" transform="translate(130, 80)">
<text text-anchor="end" x="-30">x all</text>
<use xlink:href="#marker" x="0" fill="red" />
<use xlink:href="#marker" x="20" fill="#8888FF" />
<use xlink:href="#marker" x="40" fill="#8888FF" />
<use xlink:href="#marker" x="60" fill="#8888FF" />
<use xlink:href="#marker" x="80" fill="#8888FF" />
<text font-family="embeded" font-size="20" x="20 40 60 80">1234</text>
</g>
<g xml:id="xMore" transform="translate(130, 120)">
<text text-anchor="end" x="-30">x more</text>
<use xlink:href="#marker" x="0" fill="red" />
<use xlink:href="#marker" x="20" fill="#8888FF" />
<use xlink:href="#marker" x="40" fill="#8888FF" />
<use xlink:href="#marker" x="60" fill="#8888FF" />
<use xlink:href="#marker" x="80" fill="#8888FF" />
<use xlink:href="#marker" x="100" fill="red" />
<text font-family="embeded" font-size="20" x="20 40 60 80 100">1234</text>
</g>
<g xml:id="xFewer" transform="translate(130, 160)">
<text text-anchor="end" x="-30">x fewer</text>
<use xlink:href="#marker" x="0" fill="red" />
<use xlink:href="#marker" x="20" fill="#8888FF" />
<use xlink:href="#marker" x="40" fill="#8888FF" />
<use xlink:href="#marker" x="60" fill="#8888FF" />
<use xlink:href="#marker" x="75" fill="#8888FF" />
<text font-family="embeded" font-size="20" x="20 40 60">1234</text>
</g>
<g xml:id="yAll" transform="translate(130, 200)">
<text text-anchor="end" x="-30">y all</text>
<use xlink:href="#marker" x="0" y="-10" fill="#8888FF" />
<use xlink:href="#marker" x="15" y="-5" fill="#8888FF" />
<use xlink:href="#marker" x="30" y="5" fill="#8888FF" />
<use xlink:href="#marker" x="45" y="10" fill="#8888FF" />
<text font-family="embeded" font-size="20" y="-10 -5 5 10">1234</text>
</g>
<g xml:id="yMore" transform="translate(130, 250)">
<text text-anchor="end" x="-30">y more</text>
<use xlink:href="#marker" x="0" y="-10" fill="#8888FF" />
<use xlink:href="#marker" x="15" y="-5" fill="#8888FF" />
<use xlink:href="#marker" x="30" y="5" fill="#8888FF" />
<use xlink:href="#marker" x="45" y="10" fill="#8888FF" />
<text font-family="embeded" font-size="20" y="-10 -5 5 10 20">1234</text>
</g>
<g xml:id="yFewer" transform="translate(130, 300)">
<text text-anchor="end" x="-30">y fewer</text>
<use xlink:href="#marker" x="0" y="-10" fill="#8888FF" />
<use xlink:href="#marker" x="15" y="-5" fill="#8888FF" />
<use xlink:href="#marker" x="30" y="5" fill="#8888FF" />
<use xlink:href="#marker" x="45" y="5" fill="#8888FF" />
<text font-family="embeded" font-size="20" y="-10 -5 5">1234</text>
</g>
<g transform="translate(220, 0)">
<g xml:id="xyAll" transform="translate(130, 80)">
<text text-anchor="end" x="-30">x/y all</text>
<use xlink:href="#marker" x="0" fill="red" />
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF" />
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF" />
<use xlink:href="#marker" x="60" y="5" fill="#8888FF" />
<use xlink:href="#marker" x="80" y="10" fill="#8888FF" />
<text font-family="embeded" font-size="20" x="20 40 60 80" y="-10 -5 5 10">1234</text>
</g>
<g xml:id="xyMore" transform="translate(130, 120)">
<text text-anchor="end" x="-30">x/y more</text>
<use xlink:href="#marker" x="0" fill="red" />
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF" />
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF" />
<use xlink:href="#marker" x="60" y="5" fill="#8888FF" />
<use xlink:href="#marker" x="80" y="10" fill="#8888FF" />
<use xlink:href="#marker" x="100" y="20" fill="red" />
<text font-family="embeded" font-size="20" x="20 40 60 80 100" y="-10 -5 5 10 20">1234</text>
</g>
<g xml:id="xyFewer" transform="translate(130, 160)">
<text text-anchor="end" x="-30">x/y fewer</text>
<use xlink:href="#marker" x="0" fill="red" />
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF" />
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF" />
<use xlink:href="#marker" x="60" y="5" fill="#8888FF" />
<use xlink:href="#marker" x="75" y="5" fill="#8888FF" />
<text font-family="embeded" font-size="20" x="20 40 60" y="-10 -5 5">1234</text>
</g>
<g xml:id="xAllyFewer" transform="translate(130, 200)">
<text text-anchor="end" x="-30">x all y fewer</text>
<use xlink:href="#marker" x="0" fill="red" />
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF" />
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF" />
<use xlink:href="#marker" x="60" y="5" fill="#8888FF" />
<use xlink:href="#marker" x="80" y="5" fill="#8888FF" />
<text font-family="embeded" font-size="20" x="20 40 60 80" y="-10 -5 5">1234</text>
</g>
<g xml:id="xFewerYall" transform="translate(130, 240)">
<text text-anchor="end" x="-30">x fewer y all</text>
<use xlink:href="#marker" x="0" fill="red" />
<use xlink:href="#marker" x="20" y="-10" fill="#8888FF" />
<use xlink:href="#marker" x="40" y="-5" fill="#8888FF" />
<use xlink:href="#marker" x="60" y="5" fill="#8888FF" />
<use xlink:href="#marker" x="77.52" y="10" fill="#8888FF" />
<text font-family="embeded" font-size="20" x="20 40 60" y="-10 -5 5 10">1234</text>
</g>
</g>
</g>
</g>
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
<text xml:id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.6 $</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>