218 lines
10 KiB
XML
218 lines
10 KiB
XML
<?xml version="1.0" standalone="no"?>
|
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
|
|
"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
|
|
|
|
<!-- ========================================================================= -->
|
|
<!-- Copyright (C) The Apache Software Foundation. All rights reserved. -->
|
|
<!-- -->
|
|
<!-- This software is published under the terms of the Apache Software License -->
|
|
<!-- version 1.1, a copy of which has been included with this distribution in -->
|
|
<!-- the LICENSE file. -->
|
|
<!-- ========================================================================= -->
|
|
|
|
<!-- ========================================================================= -->
|
|
<!-- This test file checks that the various combinations of units and viewbox -->
|
|
<!-- work in Batik for patternRegions -->
|
|
<!-- -->
|
|
<!-- @author vhardy@eng.sun.com -->
|
|
<!-- @version $Id: patternRegionA.svg,v 1.1.1.1 2001-06-10 01:46:41 edburns%acm.org Exp $ -->
|
|
<!-- ========================================================================= -->
|
|
|
|
<?xml-stylesheet type="text/css" href="test.css" ?>
|
|
|
|
<svg id="body" width="450" height="500" viewBox="0 0 450 500">
|
|
<title>Pattern Region Test, A</title>
|
|
|
|
<text x="225" y="50" class="title">
|
|
patternRegion, x, y, width, height
|
|
</text>
|
|
|
|
<!-- ============================================================= -->
|
|
<!-- Test content -->
|
|
<!-- ============================================================= -->
|
|
<g id="testContent" >
|
|
<defs>
|
|
|
|
<!-- ============================================== -->
|
|
<!-- The patterns in this test is always the same, -->
|
|
<!-- and the various values for the patternRegion -->
|
|
<!-- select different areas for that pattern. -->
|
|
<!-- ============================================== -->
|
|
<g id="patternContent" stroke="none" opacity="1">
|
|
<rect x="0" y="0" width="20" height="20" fill="black" />
|
|
|
|
<g fill="crimson">
|
|
<rect width="5" height="5" />
|
|
<rect x="5" y="5" width="5" height="5" />
|
|
</g>
|
|
<g fill="yellow" transform="translate(10, 0)">
|
|
<rect width="5" height="5" />
|
|
<rect x="5" y="5" width="5" height="5" />
|
|
</g>
|
|
<g fill="white" transform="translate(0, 10)">
|
|
<rect width="5" height="5" />
|
|
<rect x="5" y="5" width="5" height="5" />
|
|
</g>
|
|
<g fill="rgb(100, 100, 255)" transform="translate(10, 10)">
|
|
<rect width="5" height="5" />
|
|
<rect x="5" y="5" width="5" height="5" />
|
|
</g>
|
|
</g>
|
|
|
|
|
|
<!-- ============================================== -->
|
|
<!-- For all the following patterns: -->
|
|
<!-- -->
|
|
<!-- patternUnits : default (objectBoundingBox) -->
|
|
<!-- patternContentUnits : default (userSpaceOnUse) -->
|
|
<!-- patternTransform: default (identity) -->
|
|
<!-- viewBox : default (none) -->
|
|
<!-- preserveAspectRatio: default -->
|
|
<!-- overflow : default (hidden) -->
|
|
<!-- ============================================== -->
|
|
|
|
<!-- ============================================== -->
|
|
<!-- The pattern content fits exactly in the -->
|
|
<!-- pattern region. -->
|
|
<!-- .2 * 100 = 20 userSpaceUnits -->
|
|
<!-- .4 * 50 = 20 userSpaceUnits -->
|
|
<!-- ============================================== -->
|
|
<pattern id="patternExactFit" x="0" y="0" width=".2" height=".4">
|
|
<use xlink:href="#patternContent" />
|
|
</pattern>
|
|
|
|
<!-- ============================================== -->
|
|
<!-- The pattern content is offset along the x axis -->
|
|
<!-- .2 * 100 = 20 userSpaceUnits -->
|
|
<!-- .4 * 50 = 20 userSpaceUnits -->
|
|
<!-- ============================================== -->
|
|
<pattern id="patternTranslateRegionX"
|
|
x="-.05" y="0"
|
|
width=".2" height=".4" >
|
|
<use xlink:href="#patternContent" />
|
|
</pattern>
|
|
|
|
<!-- ============================================== -->
|
|
<!-- The pattern content is offset along the y axis -->
|
|
<!-- .2 * 100 = 20 userSpaceUnits -->
|
|
<!-- .4 * 50 = 20 userSpaceUnits -->
|
|
<!-- ============================================== -->
|
|
<pattern id="patternTranslateRegionY"
|
|
x="0" y="-.1"
|
|
width=".2" height=".4" >
|
|
<use xlink:href="#patternContent" />
|
|
</pattern>
|
|
|
|
<!-- ============================================== -->
|
|
<!-- The pattern content is offset along the both -->
|
|
<!-- both axis. -->
|
|
<!-- .2 * 100 = 20 userSpaceUnits -->
|
|
<!-- .4 * 50 = 20 userSpaceUnits -->
|
|
<!-- ============================================== -->
|
|
<pattern id="patternTranslateRegionXY"
|
|
x=".1" y=".2"
|
|
width=".2" height=".4" >
|
|
<use xlink:href="#patternContent" />
|
|
</pattern>
|
|
|
|
<!-- ============================================== -->
|
|
<!-- The pattern content width smaller width than -->
|
|
<!-- pattern region. -->
|
|
<!-- .4 * 100 = 40 userSpaceUnits -->
|
|
<!-- .4 * 50 = 20 userSpaceUnits -->
|
|
<!-- ============================================== -->
|
|
<pattern id="patternWiderRegion"
|
|
x="0" y="0"
|
|
width=".4" height=".4" >
|
|
<use xlink:href="#patternContent" />
|
|
</pattern>
|
|
|
|
<!-- ============================================== -->
|
|
<!-- The pattern content height smaller than -->
|
|
<!-- pattern region. -->
|
|
<!-- .2 * 100 = 20 userSpaceUnits -->
|
|
<!-- .8 * 50 = 40 userSpaceUnits -->
|
|
<!-- ============================================== -->
|
|
<pattern id="patternHigherRegion"
|
|
x="0" y="0"
|
|
width=".2" height=".8" >
|
|
<use xlink:href="#patternContent" />
|
|
</pattern>
|
|
|
|
<!-- ============================================== -->
|
|
<!-- The pattern content width and height smaller -->
|
|
<!-- than pattern region. -->
|
|
<!-- .4 * 100 = 40 userSpaceUnits -->
|
|
<!-- .8 * 50 = 40 userSpaceUnits -->
|
|
<!-- ============================================== -->
|
|
<pattern id="patternWiderHigherRegion"
|
|
x="0" y="0"
|
|
width=".4" height=".8" >
|
|
<use xlink:href="#patternContent" />
|
|
</pattern>
|
|
|
|
</defs>
|
|
|
|
<g transform="translate(30, 90)" >
|
|
<text class="legend" style="text-anchor:start" x="0" y="-5">Pattern (4 times actual size)</text>
|
|
<use xlink:href="#patternContent" transform="scale(4, 4)" />
|
|
</g>
|
|
|
|
<g transform="translate(30, 200)">
|
|
|
|
<g>
|
|
<text class="legend" style="text-anchor:start" x="0" y="-5">Exact Fit in patternRegion</text>
|
|
<rect x="0" y="0" width="100" height="50" fill="url(#patternExactFit)" stroke="black"/>
|
|
<rect x="0" y="0" width="20" height="20" stroke="white" fill-opacity=".12" />
|
|
</g>
|
|
|
|
<g transform="translate(0, 70)">
|
|
<text class="legend" style="text-anchor:start" x="0" y="-5">patternRegion offset to the left</text>
|
|
<rect x="0" y="0" width="100" height="50" fill="url(#patternTranslateRegionX)" stroke="black"/>
|
|
<rect x="-5" y="0" width="20" height="20" stroke="white" fill-opacity=".12"/>
|
|
</g>
|
|
|
|
<g transform="translate(0, 140)">
|
|
<text class="legend" style="text-anchor:start" x="0" y="-5">patternRegion offset to the top</text>
|
|
<rect x="0" y="0" width="100" height="50" fill="url(#patternTranslateRegionY)" stroke="black"/>
|
|
<rect x="0" y="-5" width="20" height="20" stroke="white" fill-opacity=".12" />
|
|
</g>
|
|
|
|
<g transform="translate(0, 210)">
|
|
<text class="legend" style="text-anchor:start" x="0" y="-5">patternRegion offset to the top/left</text>
|
|
<rect x="0" y="0" width="100" height="50" fill="url(#patternTranslateRegionXY)" stroke="black"/>
|
|
<rect x="10" y="10" width="20" height="20" stroke="white" fill-opacity=".12" />
|
|
</g>
|
|
|
|
</g>
|
|
|
|
<g transform="translate(255, 200)">
|
|
|
|
<g>
|
|
<text class="legend" style="text-anchor:start" x="0" y="-5">patternRegion wider than content</text>
|
|
<rect x="0" y="0" width="100" height="50" fill="url(#patternWiderRegion)" stroke="black"/>
|
|
<rect x="0" y="0" width="40" height="20" stroke="white" fill-opacity=".12" />
|
|
</g>
|
|
|
|
<g transform="translate(0, 70)">
|
|
<text class="legend" style="text-anchor:start" x="0" y="-5">patternRegion higher than content</text>
|
|
<rect x="0" y="0" width="100" height="50" fill="url(#patternHigherRegion)" stroke="black"/>
|
|
<rect x="0" y="0" width="20" height="40" stroke="white" fill-opacity=".12" />
|
|
</g>
|
|
|
|
<g transform="translate(0, 140)">
|
|
<text class="legend" style="text-anchor:start" x="0" y="-5">patternRegion higher than content</text>
|
|
<rect x="0" y="0" width="100" height="50" fill="url(#patternWiderHigherRegion)" stroke="black"/>
|
|
<rect x="0" y="0" width="40" height="40" stroke="white" fill-opacity=".12" />
|
|
</g>
|
|
</g>
|
|
|
|
</g>
|
|
|
|
<!-- ============================================================= -->
|
|
<!-- Batik sample mark -->
|
|
<!-- ============================================================= -->
|
|
<use xlink:href="../batikLogo.svg#Batik_Tag_Box" />
|
|
|
|
</svg>
|