You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by vh...@apache.org on 2001/12/06 09:13:47 UTC

cvs commit: xml-batik/test-sources/org/apache/batik/test/svg SVGRenderingAccuracyTest.java

vhardy      01/12/06 00:13:47

  Modified:    test-resources/org/apache/batik/test samplesRendering.xml
               test-sources/org/apache/batik/test/svg
                        SVGRenderingAccuracyTest.java
  Added:       samples/tests/spec/text textAnchor2.svg textAnchor3.svg
               test-references/samples/tests/spec/structure
                        systemLanguage.png systemLanguageDialect.png
               test-references/samples/tests/spec/text textAnchor2.png
                        textAnchor3.png
  Log:
  Added new text-anchor tests by Thierry and Thomas. Added reference images for
  text-anchor tests and Thierry's systemLanguage tests.
  
  Revision  Changes    Path
  1.1                  xml-batik/samples/tests/spec/text/textAnchor2.svg
  
  Index: textAnchor2.svg
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" 
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.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.                                     -->
  <!-- ====================================================================== -->
  
  <!-- ====================================================================== -->
  <!-- Tests text-anchor on multiple text chunks on single tspan element      -->
  <!--                                                                        -->
  <!-- @author tkormann@ilog.fr                                               -->
  <!-- @version $Id: textAnchor2.svg,v 1.1 2001/12/06 08:13:47 vhardy Exp $  -->
  <!-- ====================================================================== -->
  <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>  
  
  <svg width="450" height="500" viewBox="0 0 450 500" >
  
  <text class="title" x="50%" y="30">text-anchor on a single &lt;tspan&gt;</text>
  
  <g id="testContent">
  
  <!-- ################################################################# -->
  <!-- table                                                             -->
  <!-- ################################################################# -->
  <g>
  	<rect x="75" y="50"  width="300" height="20" style="fill:black; stroke:black" />
  	<rect x="75" y="70" width="300" height="40" style="fill:#eee; stroke:black" />
  	<rect x="75" y="110" width="300" height="40" style="fill:white; stroke:black" />
  	<rect x="75" y="150" width="300" height="40" style="fill:#eee; stroke:black" />
  	<text x="90" y="64" style="fill:white;font-size:14">x attribute define new text chunks</text>
  	<g style="stroke:crimson; fill:none">
  		<line x1="150" y1="70" x2="150" y2="190" />
  		<line x1="190" y1="70" x2="190" y2="190" />
  		<line x1="230" y1="70" x2="230" y2="190" />
  		<line x1="270" y1="70" x2="270" y2="190" />
  		<line x1="310" y1="70" x2="310" y2="190" />
  	</g>
  </g>
  
  <g transform="translate(0 150)">
  	<rect x="75" y="50"  width="300" height="20" style="fill:black; stroke:black" />
  	<rect x="75" y="70" width="300" height="40" style="fill:#eee; stroke:black" />
  	<rect x="75" y="110" width="300" height="40" style="fill:white; stroke:black" />
  	<rect x="75" y="150" width="300" height="40" style="fill:#eee; stroke:black" />
  	<text x="90" y="64" style="fill:white;font-size:14">y attribute define new text chunks</text>
  </g>
  
  <g transform="translate(0 300)">
  	<rect x="75" y="50"  width="300" height="20" style="fill:black; stroke:black" />
  	<rect x="75" y="70" width="300" height="40" style="fill:#eee; stroke:black" />
  	<rect x="75" y="110" width="300" height="40" style="fill:white; stroke:black" />
  	<rect x="75" y="150" width="300" height="40" style="fill:#eee; stroke:black" />
  	<text x="90" y="64" style="fill:white;font-size:14">x &amp; y attributes define new text chunks</text>
  	<g style="stroke:crimson; fill:none">
  		<line x1="150" y1="70" x2="150" y2="190" />
  		<line x1="190" y1="70" x2="190" y2="190" />
  		<line x1="230" y1="70" x2="230" y2="190" />
  		<line x1="270" y1="70" x2="270" y2="190" />
  		<line x1="310" y1="70" x2="310" y2="190" />
  	</g>
  </g>
  
  <!-- ################################################################# -->
  <!-- x attribute defines new text chunks                               -->
  <!-- ################################################################# -->
  
  <text transform="translate(150 94)"><tspan x="0 40 80 120 160" style="text-anchor:start">Batik</tspan></text>
  <text transform="translate(150 134)"><tspan x="0 40 80 120 160" style="text-anchor:middle">Batik</tspan></text>
  <text transform="translate(150 174)"><tspan x="0 40 80 120 160" style="text-anchor:end">Batik</tspan></text>
  
  <!-- ################################################################# -->
  <!-- y attribute defines new text chunks                               -->
  <!-- ################################################################# -->
  <text transform="translate(210 240)"><tspan y="0 10 0 10 0" style="text-anchor:start">Batik</tspan></text>
  <text transform="translate(210 280)"><tspan y="0 10 0 10 0" style="text-anchor:middle">Batik</tspan></text>
  <text transform="translate(210 320)"><tspan y="0 10 0 10 0" style="text-anchor:end">Batik</tspan></text>
  
  <!-- ################################################################# -->
  <!-- both x and y attributes define new text chunks                    -->
  <!-- ################################################################# -->
  <text transform="translate(150 390)"><tspan x="0 40 80 120 160" y="0 10 0 10 0" style="text-anchor:start">Batik</tspan></text>
  <text transform="translate(150 430)"><tspan x="0 40 80 120 160" y="0 10 0 10 0" style="text-anchor:middle">Batik</tspan></text>
  <text transform="translate(150 470)"><tspan x="0 40 80 120 160" y="0 10 0 10 0" style="text-anchor:end">Batik</tspan></text>
  
  </g>
  
  </svg>
  
  
  
  1.1                  xml-batik/samples/tests/spec/text/textAnchor3.svg
  
  Index: textAnchor3.svg
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" 
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.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.                                     -->
  <!-- ====================================================================== -->
  
  <!-- ====================================================================== -->
  <!-- Tests text-anchor on multiple text chunks on single tspan element      -->
  <!--                                                                        -->
  <!-- @author tkormann@ilog.fr                                               -->
  <!-- @version $Id: textAnchor3.svg,v 1.1 2001/12/06 08:13:47 vhardy Exp $  -->
  <!-- ====================================================================== -->
  <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>  
  
  <svg width="450" height="500" viewBox="0 0 450 500" >
  
  <text class="title" x="50%" y="30">text-anchor on a single &lt;tspan&gt;</text>
  
  <g id="testContent">
  
  <!-- ################################################################# -->
  <!-- table                                                             -->
  <!-- ################################################################# -->
  <g>
  	<rect x="75" y="50"  width="300" height="20" style="fill:black; stroke:black" />
  	<rect x="75" y="70" width="300" height="40" style="fill:#eee; stroke:black" />
  	<rect x="75" y="110" width="300" height="40" style="fill:white; stroke:black" />
  	<rect x="75" y="150" width="300" height="40" style="fill:#eee; stroke:black" />
  	<text x="90" y="64" style="fill:white;font-size:14">x attributed tspan with extra text</text>
  	<g style="stroke:lightsteelblue; fill:none">
  		<line x1="150" y1="70" x2="150" y2="190" />
  		<line x1="190" y1="70" x2="190" y2="190" />
  		<line x1="230" y1="70" x2="230" y2="190" />
  		<line x1="270" y1="70" x2="270" y2="190" />
  		<line x1="310" y1="70" x2="310" y2="190" />
  	</g>
  </g>
  
  <g transform="translate(0 150)">
  	<rect x="75" y="50"  width="300" height="20" style="fill:black; stroke:black" />
  	<rect x="75" y="70" width="300" height="40" style="fill:#eee; stroke:black" />
  	<rect x="75" y="110" width="300" height="40" style="fill:white; stroke:black" />
  	<rect x="75" y="150" width="300" height="40" style="fill:#eee; stroke:black" />
  	<text x="90" y="64" style="fill:white;font-size:14">x attribute for some chars</text>
  	<g style="stroke:lightsteelblue; fill:none">
  		<line x1="150" y1="70" x2="150" y2="190" />
  		<line x1="190" y1="70" x2="190" y2="190" />
  		<line x1="230" y1="70" x2="230" y2="190" />
  	</g>
  </g>
  
  <g transform="translate(0 300)">
  	<rect x="75" y="50"  width="300" height="20" style="fill:black; stroke:black" />
  	<rect x="75" y="70" width="300" height="40" style="fill:#eee; stroke:black" />
  	<rect x="75" y="110" width="300" height="40" style="fill:white; stroke:black" />
  	<rect x="75" y="150" width="300" height="40" style="fill:#eee; stroke:black" />
  	<text x="90" y="64" style="fill:white;font-size:14">x &amp; y attributes with inheritance</text>
  	<g style="stroke:lightsteelblue; fill:none">
  		<line x1="150" y1="70" x2="150" y2="190" />
  		<line x1="190" y1="70" x2="190" y2="190" />
  		<line x1="230" y1="70" x2="230" y2="190" />
  		<line x1="270" y1="70" x2="270" y2="190" />
  	</g>
  </g>
  
  <!-- ################################################################# -->
  <!-- x attribute defines new text chunks extra text after tspan        -->
  <!-- ################################################################# -->
  
  <text transform="translate(150  94)"><tspan x="0 40 80 120 160" y="0 0 0 0 10" style="text-anchor:start">Batik</tspan><tspan fill="crimson"> rules!</tspan></text>
  <text transform="translate(150 134)"><tspan x="0 40 80 120 160" y="0 0 0 0 10" style="text-anchor:middle">Batik</tspan><tspan fill="crimson"> rules!</tspan></text>
  <text transform="translate(150 174)"><tspan x="0 40 80 120 160" y="0 0 0 0 10" style="text-anchor:end">Batik</tspan><tspan fill="crimson"> rules!</tspan></text>
  
  <!-- ################################################################# -->
  <!-- x attribute defines new text chunks for only some chars           -->
  <!-- ################################################################# -->
  <text transform="translate(150 240)"><tspan x="0 40 80" style="text-anchor:start">Batik</tspan></text>
  <text transform="translate(150 280)"><tspan x="0 40 80" style="text-anchor:middle">Batik</tspan></text>
  <text transform="translate(150 320)"><tspan x="0 40 80" style="text-anchor:end">Batik</tspan></text>
  
  <!-- ################################################################# -->
  <!-- both x and y attributes define new text chunks                    -->
  <!-- ################################################################# -->
  <text transform="translate(150 390)" x="0 0 0 120"><tspan x="0 40 80" y="0 10 0 10" style="text-anchor:start">Batik</tspan><tspan fill="crimson"> rules!</tspan></text>
  <text transform="translate(150 430)" x="0 0 0 120"><tspan x="0 40 80" y="0 10 0 10" style="text-anchor:middle">Batik</tspan><tspan fill="crimson"> rules!</tspan></text>
  <text transform="translate(150 470)" x="0 0 0 120"><tspan x="0 40 80" y="0 10 0 10" style="text-anchor:end">Batik</tspan><tspan fill="crimson"> rules!</tspan></text>
  
  </g>
  
  </svg>
  
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/structure/systemLanguage.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/structure/systemLanguageDialect.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/text/textAnchor2.png
  
  	<<Binary file>>
  
  
  1.1                  xml-batik/test-references/samples/tests/spec/text/textAnchor3.png
  
  	<<Binary file>>
  
  
  1.56      +9 -1      xml-batik/test-resources/org/apache/batik/test/samplesRendering.xml
  
  Index: samplesRendering.xml
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-resources/org/apache/batik/test/samplesRendering.xml,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- samplesRendering.xml	2001/12/05 13:46:05	1.55
  +++ samplesRendering.xml	2001/12/06 08:13:47	1.56
  @@ -8,7 +8,7 @@
   
   <!-- ========================================================================= -->
   <!-- @author vincent.hardy@eng.sun.com                                         -->
  -<!-- @version $Id: samplesRendering.xml,v 1.55 2001/12/05 13:46:05 deweese Exp $ -->
  +<!-- @version $Id: samplesRendering.xml,v 1.56 2001/12/06 08:13:47 vhardy Exp $ -->
   <!-- ========================================================================= -->
   <testSuite id="samplesRendering" name="samples and samples/test Rendering" class="org.apache.batik.test.svg.SamplesRenderingTest">
   
  @@ -190,6 +190,12 @@
           <test id="samples/tests/spec/structure/xmlBaseStyling.svg" />
           <test id="samples/tests/spec/structure/requiredFeatures.svg" />
           <test id="samples/tests/spec/structure/requiredFeaturesCombo.svg" />
  +        <test id="samples/tests/spec/structure/systemLanguage.svg">
  +            <property name="UserLanguage" class="java.lang.String" value="fr" />
  +        </test>
  +        <test id="samples/tests/spec/structure/systemLanguageDialect.svg">
  +            <property name="UserLanguage" class="java.lang.String" value="en-UK" />
  +        </test>
       </testGroup>
   
       <testGroup id="tests.spec.styling">
  @@ -223,6 +229,8 @@
           <test id="samples/tests/spec/text/longTextOnPath.svg" />
           <test id="samples/tests/spec/text/smallFonts.svg" />
           <test id="samples/tests/spec/text/textAnchor.svg" />
  +        <test id="samples/tests/spec/text/textAnchor2.svg" />
  +        <test id="samples/tests/spec/text/textAnchor3.svg" />
           <test id="samples/tests/spec/text/textBiDi.svg" />
           <test id="samples/tests/spec/text/textDecoration.svg" />
           <test id="samples/tests/spec/text/textEffect.svg" />
  
  
  
  1.27      +23 -3     xml-batik/test-sources/org/apache/batik/test/svg/SVGRenderingAccuracyTest.java
  
  Index: SVGRenderingAccuracyTest.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-sources/org/apache/batik/test/svg/SVGRenderingAccuracyTest.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- SVGRenderingAccuracyTest.java	2001/12/05 13:46:05	1.26
  +++ SVGRenderingAccuracyTest.java	2001/12/06 08:13:47	1.27
  @@ -67,7 +67,7 @@
    * all pixel values are the same).
    *
    * @author <a href="mailto:vhardy@apache.lorg">Vincent Hardy</a>
  - * @version $Id: SVGRenderingAccuracyTest.java,v 1.26 2001/12/05 13:46:05 deweese Exp $
  + * @version $Id: SVGRenderingAccuracyTest.java,v 1.27 2001/12/06 08:13:47 vhardy Exp $
    */
   public class SVGRenderingAccuracyTest extends AbstractTest {
       /**
  @@ -270,6 +270,11 @@
       protected static File tempDirectory;
   
       /**
  +     * The userLanguage for which the document should be tested.
  +     */
  +    protected String userLanguage;
  +
  +    /**
        * Returns the temporary directory
        */
       public static File getTempDirectory(){
  @@ -348,6 +353,17 @@
       }
   
       /**
  +     * Sets the userLanguage
  +     */
  +    public void setUserLanguage(String userLanguage){
  +        this.userLanguage = userLanguage;
  +    }
  +
  +    public String getUserLanguage(){
  +        return this.userLanguage;
  +    }
  +
  +    /**
        * Sets the File where the variation from the reference image should be
        * stored
        */
  @@ -939,10 +955,14 @@
           if (validate){
               t.addTranscodingHint(PNGTranscoder.KEY_XML_PARSER_VALIDATING,
                                    new Boolean(true));
  -	    t.addTranscodingHint(PNGTranscoder.KEY_XML_PARSER_CLASSNAME,
  -				 VALIDATING_PARSER);
  +            t.addTranscodingHint(PNGTranscoder.KEY_XML_PARSER_CLASSNAME,
  +                                 VALIDATING_PARSER);
           }
   
  +        if (userLanguage != null){
  +            t.addTranscodingHint(PNGTranscoder.KEY_LANGUAGE, 
  +                                 userLanguage);
  +        }
           return t;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org