blob: 46a094670f195b4919f98d6efe750a64f58c38f7 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd" [
<!ENTITY Smile "
<rect x='.5' y='.5' width='29' height='39' fill='black' stroke='red'/>
<g transform='translate(0, 5)'>
<circle cx='15' cy='15' r='10' fill='yellow'/>
<circle cx='12' cy='12' r='1.5' fill='black'/>
<circle cx='17' cy='12' r='1.5' fill='black'/>
<path d='M 10 19 L 15 23 20 19' stroke='black' stroke-width='2'/>
</g>
">
<!ENTITY Viewport1 "<rect x='.5' y='.5' width='49' height='29'
fill='none' stroke='blue'/>">
<!ENTITY Viewport2 "<rect x='.5' y='.5' width='29' height='59'
fill='none' stroke='blue'/>">
]>
<!--======================================================================-->
<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, Institut National de Recherche en =-->
<!--= Informatique et en Automatique, Keio University). All Rights =-->
<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
<!--======================================================================-->
<!-- ===================================================================== -->
<!-- The content of this test is taken from the SVG specification. The -->
<!-- original author is Jon Ferraiolo. -->
<!-- coords-viewBox-BE-03.svg -->
<!-- renamed for 1.1 suite to coords-viewattr-01-b.svg -->
<!-- Author : Vincent Hardy -->
<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
<!--======================================================================-->
<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
<OperatorScript version="$Revision: 1.6 $" testname="coords-viewattr-01-b.svg">
<Paragraph>
This test verifies the implementation of the viewBox and the preserveAspectRatio attribute.
This is a modified version of the sample file included in the SVG specification.
It exercises the various preserveAspectRatio values and uses a general entity definition
in order to make reading of the SVG source easier.
</Paragraph>
<Paragraph>
The rendered picture should match the reference image exactly except for variations in the labeling text.
</Paragraph>
</OperatorScript>
</SVGTestCase>
<title id="test-title">coords-viewattr-01-b</title>
<desc id="test-desc">Validates viewBox specification and the preserveAspectRatio attribute</desc>
<!--======================================================================-->
<!--Content of Test Case follows... =====================-->
<!--======================================================================-->
<g id="test-body-content" transform="translate(0, 30)">
<g font-size="9">
<desc>Example PreserveAspectRatio - demonstrate available options</desc>
<text x="10" y="30">SVG to fit</text>
<g transform="translate(20,40)">&Smile;</g>
<text x="10" y="110">Viewport 1</text>
<g transform="translate(10,120)">&Viewport1;</g>
<text x="10" y="180">Viewport 2</text>
<g transform="translate(20,190)">&Viewport2;</g>
<g id="meet-group-1" transform="translate(120, 50)">
<text x="0" y="-20">---------- meet --------------------</text>
<g>
<text y="-5">xMin*</text>&Viewport1;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMinYMin meet" viewBox="0 0 30 40" width="50" height="30">&Smile;</svg>
</g>
<g transform="translate(70,0)">
<text y="-5">xMid*</text>&Viewport1;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="0 0 30 40" width="50" height="30">&Smile;</svg>
</g>
<g transform="translate(0,50)">
<text y="-5">xMax*</text>&Viewport1;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMaxYMax meet" viewBox="0 0 30 40" width="50" height="30">&Smile;</svg>
</g>
</g>
<g id="meet-group-2" transform="translate(300, 50)">
<text x="0" y="-20">---------- meet ------------------------</text>
<g>
<text y="-5">*YMin</text>&Viewport2;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMinYMin meet" viewBox="0 0 30 40" width="30" height="60">&Smile;</svg>
</g>
<g transform="translate(50, 0)">
<text y="-5">*YMid</text>&Viewport2;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="0 0 30 40" width="30" height="60">&Smile;</svg>
</g>
<g transform="translate(100, 0)">
<text y="-5">*YMax</text>&Viewport2;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMaxYMax meet" viewBox="0 0 30 40" width="30" height="60">&Smile;</svg>
</g>
</g>
<g id="slice-group-1" transform="translate(120, 185)">
<text x="0" y="-20">---------- slice -------------------------</text>
<g>
<text y="-5">xMin*</text>&Viewport2;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMinYMin slice" viewBox="0 0 30 40" width="30" height="60">&Smile;</svg>
</g>
<g transform="translate(50,0)">
<text y="-5">xMid*</text>&Viewport2;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid slice" viewBox="0 0 30 40" width="30" height="60">&Smile;</svg>
</g>
<g transform="translate(100,0)">
<text y="-5">xMax*</text>&Viewport2;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMaxYMax slice" viewBox="0 0 30 40" width="30" height="60">&Smile;</svg>
</g>
</g>
<g id="slide-group-2" transform="translate(300, 155) translate(0, 30)">
<text x="0" y="-20">---------- slice ---------------------</text>
<g>
<text y="-5">*YMin</text>&Viewport1;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMinYMin slice" viewBox="0 0 30 40" width="50" height="30">&Smile;</svg>
</g>
<g transform="translate(70,0)">
<text y="-5">*YMid</text>&Viewport1;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid slice" viewBox="0 0 30 40" width="50" height="30">&Smile;</svg>
</g>
<g transform="translate(0,50)">
<text y="-5">*YMax</text>&Viewport1;
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMaxYMax slice" viewBox="0 0 30 40" width="50" height="30">&Smile;</svg>
</g>
</g>
</g>
</g>
<text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.6 $</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</svg>