You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by de...@apache.org on 2005/09/25 20:00:07 UTC
svn commit: r291451 [22/22] - in /xmlgraphics/batik/branches/svg11: ./
samples/tests/resources/wmf/ samples/tests/spec/text/
sources/org/apache/batik/ext/awt/geom/ sources/org/apache/batik/svggen/
sources/org/apache/batik/transcoder/ sources/org/apache...
Added: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/testChart.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/testChart.svg?rev=291451&view=auto
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/testChart.svg (added)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/testChart.svg Sun Sep 25 10:58:29 2005
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
+ 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
+<svg stroke-dasharray="none" shape-rendering="auto" xmlns="http://www.w3.org/2000/svg" font-family="'Arial'" width="1056" text-rendering="auto" fill-opacity="1" contentScriptType="text/ecmascript" color-rendering="auto" color-interpolation="auto" preserveAspectRatio="xMidYMid meet" font-size="12" viewBox="0 0 1056 816" fill="black" xmlns:xlink="http://www.w3.org/1999/xlink" stroke="black" image-rendering="auto" stroke-miterlimit="10" zoomAndPan="magnify" version="1.0" stroke-linecap="square" stroke-linejoin="miter" contentStyleType="text/css" font-style="normal" height="816" stroke-width="1" stroke-dashoffset="0" font-weight="normal" stroke-opacity="1"
+><!--Generated by the Batik Graphics2D SVG Generator--><defs id="genericDefs"
+ /><g
+ ><defs id="defs1"
+ ><pattern x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern1" height="10" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAOklEQVR42o3NQQ4A
+IAgDwZb//1mFg4kK0j1PWgIYK3SZgkjCFORjpqC4VlAJb5TCDD2wQgf8oQ075E23
+tx8QKLvT2gAAAABJRU5ErkJggg==" xlink:type="simple" xlink:actuate="onLoad" height="10" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern2" height="10" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAH0lEQVR42mNkYGD4
+z0AEYAER//8TVsvEQCQYVYgXAADl9AQSAIUWgQAAAABJRU5ErkJggg==" xlink:type="simple" xlink:actuate="onLoad" height="10" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="8" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern3" height="8" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="8" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAM0lEQVR42m2OsQ0A
+QAgChf13Rho/5AOddwaFpLkAeCMnYmpXRDpkVXayUm+z0v9G/yqps266GwzTfgxK
+AAAAAElFTkSuQmCC" xlink:type="simple" xlink:actuate="onLoad" height="8" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="8" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern4" height="8" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="8" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAOklEQVR42mNgAIP/
+//9DSAgAshkZYADCBwkxggSZMEUROjBFUUxHNhPEhduGDIAi6HZA2IwQB2C1AwDv
+GDvbZ2CR/gAAAABJRU5ErkJggg==" xlink:type="simple" xlink:actuate="onLoad" height="8" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern5" height="10" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAASklEQVR42oXPUQoA
+IAgD0Ln737myEMRc+ekeNQ3AWIPf0JGZPZHnxHlSYt97zlh0OND+OgcZZ3TBjOuB
+VJ1qDapOFbNDXWcqVPEEfe80ExU5GvgAAAAASUVORK5CYII=" xlink:type="simple" xlink:actuate="onLoad" height="10" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern6" height="10" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAHklEQVR42mNkYGD4
+z0AEYPn/nyh1DEwMRIJRhXgBAPHoBBIyVomkAAAAAElFTkSuQmCC" xlink:type="simple" xlink:actuate="onLoad" height="10" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern7" height="10" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGklEQVR42mNkYGD4
+DwQMhAATA5FgVCF1FAIAXaYEEMKvnIEAAAAASUVORK5CYII=" xlink:type="simple" xlink:actuate="onLoad" height="10" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern8" height="10" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQUlEQVR42oXQSQoA
+MAgDwCT//3MXiiCijScto2gJYJ2AC11E0kO8kRYrEoeVix9WfZiwuu4Oa9qpYv0u
+zVju/wJvF2YfEFUgIOwAAAAASUVORK5CYII=" xlink:type="simple" xlink:actuate="onLoad" height="10" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern9" height="10" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42mP8z8Dw
+HwgJAiawIkZiFIIAEYqZ4CwCiplQeHgUM2GI4FDMhFU7FsVMOB2FppgJr1eRFDMR
+DECoYgBjXAwRld6/zwAAAABJRU5ErkJggg==" xlink:type="simple" xlink:actuate="onLoad" height="10" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern10" height="10" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="10" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQUlEQVR42oXQSQoA
+MAgDwCT//3MXiiCijScto2gJYJ2AC11E0kO8kRYrEoeVix9WfZiwuu4Oa9qpYv0u
+zVju/wJvF2YfEFUgIOwAAAAASUVORK5CYII=" xlink:type="simple" xlink:actuate="onLoad" height="10" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="8" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern11" height="8" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="8" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAJklEQVR42mP8//8/
+AxgwMjIyIAFGuASKKCMjEwMOQLoEdjvIMgoAOSQJC7g1m/AAAAAASUVORK5CYII=" xlink:type="simple" xlink:actuate="onLoad" height="8" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ><pattern x="0" y="0" width="8" xmlns:xlink="http://www.w3.org/1999/xlink" patternUnits="userSpaceOnUse" xlink:type="simple" xlink:actuate="onLoad" id="pattern12" height="8" preserveAspectRatio="xMidYMid meet" xlink:show="other"
+ ><image x="0" y="0" width="8" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAJUlEQVR42mNgwAX+
+//+PVZwJlxwTLn1MuMxkwmUfEy63MOFyJwBK/hT4sr1A4wAAAABJRU5ErkJggg==" xlink:type="simple" xlink:actuate="onLoad" height="8" preserveAspectRatio="none" xlink:show="embed"
+ /></pattern
+ ></defs
+ ><g stroke-width="1.5118" stroke-linecap="butt" stroke-linejoin="round"
+ ><rect fill="none" width="454.3748" x="47.2441" height="156.6992" y="580.989"
+ /><rect fill="none" width="451.9937" x="549.2787" height="156.6992" y="580.989"
+ /><rect fill="none" width="454.3748" x="549.2787" height="154.3181" y="174.7654"
+ /><rect fill="none" width="454.3748" x="47.2441" height="153.1086" y="178.3181"
+ /><text x="33.0315" font-size="63" y="84.1701" text-decoration="underline" stroke="none" font-weight="bold"
+ >Metafile Companion Test Chart</text
+ ></g
+ ><g font-size="26" stroke-linecap="butt" transform="translate(70.1858,185.4992)" fill="white" stroke-linejoin="round" stroke="white" font-weight="bold" stroke-width="1.5118"
+ ><rect width="100" x="0" height="25" y="-19" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-weight="bold" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="70.1858" y="185.4992" stroke="none"
+ >Objects</text
+ ><rect x="0" y="-19" transform="translate(573.4677,185.4992)" fill="white" width="86" height="20" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-weight="bold" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="573.4677" y="185.4992" stroke="none"
+ >Colors</text
+ ><rect x="-1" y="-19" transform="translate(573.4677,591.7606)" fill="white" width="130" height="20" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-weight="bold" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="573.4677" y="591.7606" stroke="none"
+ >Advanced</text
+ ><rect x="1" y="-19" transform="translate(72.7559,591.6094)" fill="white" width="54" height="20" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-weight="bold" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="72.7559" y="591.6094" stroke="none"
+ >Fills</text
+ ><line fill="none" x1="70.1102" x2="112.8945" y1="278.9291" y2="230.8535" stroke-width="0.7559"
+ /><rect x="200.8063" y="235.011" fill="none" width="42.1417" height="39.7607" stroke-width="0.7559"
+ /><ellipse fill="none" rx="26.9858" cx="295.1055" ry="24.0189" cy="256.6488" stroke-width="0.7559"
+ /></g
+ ><g font-size="26" stroke-linecap="butt" transform="translate(857.7512,672.0977) rotate(-20)" fill="white" stroke-linejoin="round" stroke="white" stroke-width="0.7559"
+ ><rect width="88" x="2" height="20" y="-19" stroke="none"
+ /></g
+ ><g font-size="26" transform="matrix(0.9397,-0.342,0.342,0.9397,-216.0685,358.3464)" stroke-linejoin="round" stroke-linecap="butt"
+ ><text x="945.7512" y="662.0977" stroke="none"
+ >Rotated</text
+ ></g
+ ><g font-size="26" stroke-linecap="butt" transform="translate(433.1717,263.3575)" fill="white" stroke-linejoin="round" stroke="white" stroke-width="0.7559"
+ ><rect width="51" x="0" height="20" y="-19" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="0.7559" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="433.1717" y="263.3575" stroke="none"
+ >Text</text
+ ><path fill="silver" stroke-width="0.0378" d="M792.6047 679.7858 L830.4 625.3607 L866.6835 679.7858 ZM806.3622 673.5874 L829.6441 638.9669 L852.6236 673.5874 ZM818.3055 665.5748 L828.8882 649.852 L839.3197 665.5748 Z" fill-rule="evenodd" stroke="none"
+ /><path fill="none" d="M792.6047 679.7858 L830.4 625.3607 L866.6835 679.7858 Z" stroke-width="0.0378"
+ /><path fill="none" d="M806.3622 673.5874 L829.6441 638.9669 L852.6236 673.5874 Z" stroke-width="0.0378"
+ /><path fill="none" d="M818.3055 665.5748 L828.8882 649.852 L839.3197 665.5748 Z" stroke-width="0.0378"
+ /><line fill="none" x1="75.4772" x2="174.0472" y1="478.7906" y2="478.7906" stroke-dasharray="15.0857,6.0343,3.0171,6.0343,3.0171,6.0343" stroke-width="0.0378" stroke-miterlimit="45.2571"
+ /><line fill="none" x1="75.4772" x2="174.0472" y1="441.1465" y2="441.1465" stroke-dasharray="3.0171,15.0857" stroke-width="0.0378" stroke-miterlimit="30.1714"
+ /><line fill="none" x1="74.1165" x2="172.6866" y1="403.5023" y2="403.5023" stroke-width="0.0378"
+ /><line fill="none" x1="74.1165" x2="172.6866" y1="421.6441" y2="421.6441" stroke-dasharray="15.0857,6.0343" stroke-width="0.0378" stroke-miterlimit="30.1714"
+ /><line fill="none" x1="75.4772" x2="174.0472" y1="459.2882" y2="459.2882" stroke-dasharray="15.0857,6.0343,3.0171,6.0343" stroke-width="0.0378" stroke-miterlimit="30.1714"
+ /><rect x="133.4929" y="661.304" fill="url(#pattern1)" width="44.485" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="133.4929" y="661.304" fill="none" width="44.485" height="44.485" stroke-width="0.0378"
+ /><rect x="191.3575" y="661.304" fill="url(#pattern2)" width="44.485" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="191.3575" y="661.304" fill="none" width="44.485" height="44.485" stroke-width="0.0378"
+ /><rect x="354.3685" y="606.9921" fill="url(#pattern3)" width="44.485" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="354.3685" y="606.9921" fill="none" width="44.485" height="44.485" stroke-width="0.0378"
+ /><rect x="871.748" y="232.6299" fill="blue" width="45.6567" height="45.6567" stroke="none" stroke-width="0.0378"
+ /><rect x="871.748" y="232.6299" fill="none" width="45.6567" height="45.6567" stroke-width="0.0378"
+ /><rect x="815.0173" y="232.6299" fill="green" width="44.5228" height="45.6567" stroke="none" stroke-width="0.0378"
+ /><rect x="815.0173" y="232.6299" fill="none" width="44.5228" height="45.6567" stroke-width="0.0378"
+ /><rect x="411.0614" y="606.9921" fill="url(#pattern4)" width="49.2095" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="411.0614" y="606.9921" fill="none" width="49.2095" height="44.485" stroke-width="0.0378"
+ /><rect x="248.0504" y="661.304" fill="url(#pattern5)" width="45.6945" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="248.0504" y="661.304" fill="none" width="45.6945" height="44.485" stroke-width="0.0378"
+ /><rect x="929.6126" y="232.6299" fill="yellow" width="45.6945" height="45.6567" stroke="none" stroke-width="0.0378"
+ /><rect x="929.6126" y="232.6299" fill="none" width="45.6945" height="45.6567" stroke-width="0.0378"
+ /><line fill="none" x1="228.4724" x2="327.0425" y1="439.937" y2="439.937" stroke-width="4.5354"
+ /><line fill="none" x1="227.1118" x2="325.6819" y1="402.2929" y2="402.2929" stroke-width="0.0378"
+ /><line fill="none" x1="227.1118" x2="325.6819" y1="420.4346" y2="420.4346" stroke-width="2.2677"
+ /><line fill="none" x1="228.4724" x2="327.0425" y1="458.0787" y2="458.0787" stroke-width="6.8031"
+ /><line fill="none" x1="228.4724" x2="327.0425" y1="477.5811" y2="477.5811" stroke-width="9.0709"
+ /><rect x="133.4929" y="606.9921" fill="none" width="44.485" height="44.485" stroke-width="0.0378"
+ /><rect x="75.5906" y="606.9921" width="45.6945" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="75.5906" y="606.9921" fill="none" width="45.6945" height="44.485" stroke-width="0.0378"
+ /><rect x="191.3575" y="606.9921" fill="url(#pattern6)" width="44.485" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="191.3575" y="606.9921" fill="none" width="44.485" height="44.485" stroke-width="0.0378"
+ /><rect x="248.0504" y="606.9921" fill="url(#pattern7)" width="45.6945" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="248.0504" y="606.9921" fill="none" width="45.6945" height="44.485" stroke-width="0.0378"
+ /><rect x="639.0425" y="232.6299" fill="white" width="44.485" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="639.0425" y="232.6299" fill="none" width="44.485" height="44.485" stroke-width="0.0378"
+ /><rect x="581.1401" y="232.6299" width="45.6945" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="581.1401" y="232.6299" fill="none" width="45.6945" height="44.485" stroke-width="0.0378"
+ /><rect x="696.9071" y="232.6299" fill="gray" width="44.5228" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="696.9071" y="232.6299" fill="none" width="44.5228" height="44.485" stroke-width="0.0378"
+ /><rect x="753.6" y="232.6299" fill="red" width="45.6945" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="753.6" y="232.6299" fill="none" width="45.6945" height="44.485" stroke-width="0.0378"
+ /><rect x="75.5906" y="661.304" fill="url(#pattern8)" width="45.6945" height="44.485" stroke="none" stroke-width="0.0378"
+ /><rect x="75.5906" y="661.304" fill="none" width="45.6945" height="44.485" stroke-width="0.0378"
+ /><path fill="none" d="M123.4772 279.1559 L149.3291 250.5827 L166.2614 263.5843 L188.3339 232.4409"
+ /><path fill="none" d="M96.4157 254.1354 L96.5669 254.1354"
+ /><path fill="none" d="M352.8945 234.9354 L352.8945 257.1591 L374.6646 276.2079 L408.5291 276.2079 L404.7496 228.1323 L383.1307 248.3905 Z"
+ /><rect x="47.2441" y="376.7055" fill="none" width="454.3748" height="153.1465" stroke-width="1.5118"
+ /></g
+ ><g font-size="26" stroke-linecap="butt" transform="translate(74.1165,386.5701)" fill="white" stroke-linejoin="round" stroke="white" font-weight="bold" stroke-width="1.5118"
+ ><rect width="70" x="1" height="20" y="-19" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-weight="bold" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="74.1165" y="386.5701" stroke="none"
+ >Lines</text
+ ><rect fill="none" width="451.9937" x="549.2787" height="156.6614" y="376.7055"
+ /><rect x="1" y="-19" transform="translate(574.8284,387.9307)" fill="white" width="73" height="20" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-weight="bold" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="574.8284" y="387.9307" stroke="none"
+ >Fonts</text
+ ><rect x="1" y="-19" transform="translate(820.0441,434.3433)" fill="white" width="59" height="20" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-weight="bold" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="820.0441" y="434.3433" stroke="none"
+ >Bold</text
+ ></g
+ ><g font-size="26" stroke-linecap="butt" transform="translate(822.6142,499.3512)" fill="white" font-family="'Courier New'" stroke-linejoin="round" stroke="white" stroke-width="1.5118"
+ ><rect width="138" x="1" height="18" y="-17" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-family="'Courier New'" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="822.6142" y="499.3512" text-decoration="underline" stroke="none"
+ >Underline</text
+ ></g
+ ><g font-size="26" stroke-linecap="butt" transform="translate(821.2535,465.4866)" fill="white" font-family="'Times New Roman'" stroke-linejoin="round" font-style="italic" stroke="white" stroke-width="1.5118"
+ ><rect width="58" x="-1" height="20" y="-19" stroke="none"
+ /></g
+ ><g font-size="26" stroke-linecap="butt" font-family="'Times New Roman'" stroke-linejoin="round" font-style="italic" stroke-width="1.5118"
+ ><text x="821.2535" y="465.4866" stroke="none"
+ >Italic</text
+ ></g
+ ><g font-size="26" stroke-linecap="butt" transform="translate(574.6772,433.1339)" fill="white" stroke-linejoin="round" stroke="white" stroke-width="1.5118"
+ ><rect width="52" x="-1" height="20" y="-19" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="574.6772" y="433.1339" stroke="none"
+ >Arial</text
+ ><rect x="0" y="-19" transform="translate(573.3165,465.4866)" fill="white" width="203" height="20" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-family="'Times New Roman'" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="573.3165" y="465.4866" stroke="none"
+ >Times New Roman</text
+ ><rect x="1" y="-17" transform="translate(574.6772,499.3512)" fill="white" width="170" height="18" stroke="none"
+ /></g
+ ><g font-size="26" stroke-width="1.5118" font-family="'Courier New'" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="574.6772" y="499.3512" stroke="none"
+ >Courier New</text
+ ><rect x="579.9685" y="628.2331" fill="url(#pattern9)" width="45.6945" height="45.6567" stroke="none" stroke-width="0.0378"
+ /><rect x="579.9685" y="628.2331" fill="none" width="45.6945" height="45.6567" stroke-width="0.0378"
+ /><rect x="675.6661" y="618.7842" fill="yellow" width="64.5543" height="45.6567" stroke="none" stroke-width="0.0378"
+ /><rect x="675.6661" y="618.7842" fill="none" width="64.5543" height="45.6567" stroke-width="0.0378"
+ /><rect x="656.7685" y="634.1292" fill="url(#pattern10)" width="48.0378" height="45.6945" stroke="none" stroke-width="0.0378"
+ /><rect x="656.7685" y="634.1292" fill="none" width="48.0378" height="45.6945" stroke-width="0.0378"
+ /><rect x="714.6331" y="634.1292" fill="url(#pattern10)" width="44.485" height="45.6945" stroke="none" stroke-width="0.0378"
+ /><rect x="714.6331" y="634.1292" fill="none" width="44.485" height="45.6945" stroke-width="0.0378"
+ /><text font-size="15" x="933.7166" y="721.9653" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Text</text
+ ><text font-size="15" x="921.7976" y="705.1843" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Rotated</text
+ ><text font-size="15" x="565.9843" y="705.9401" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Background</text
+ ><text font-size="15" x="585.1843" y="722.7213" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Color</text
+ ><text font-size="15" x="801.6756" y="706.3937" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Complex</text
+ ><text font-size="15" x="807.1181" y="723.1748" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Polygon</text
+ ><text font-size="15" x="664.8567" y="705.9401" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Transparency</text
+ ><text font-size="15" x="98.4945" y="502.2236" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Patterns</text
+ ><text font-size="15" x="248.2772" y="503.4331" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Thickness</text
+ ><text font-size="15" x="345.9126" y="725.7071" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Bitmap Fill Patterns</text
+ ><text font-size="15" x="130.6882" y="725.4047" font-family="'Times New Roman'" stroke="none" stroke-width="0.0378"
+ >Basic Fill Patterns</text
+ ></g
+ ><g font-size="15" stroke-linecap="butt" fill="url(#pattern11)" font-family="'Times New Roman'" stroke-linejoin="round" stroke="url(#pattern11)" stroke-width="0.0378"
+ ><rect width="44.485" x="354.3685" height="44.485" y="661.304" stroke="none"
+ /><rect x="354.3685" y="661.304" fill="none" width="44.485" height="44.485" stroke="black"
+ /><rect x="411.0614" y="661.304" fill="url(#pattern12)" width="49.2095" height="44.485" stroke="none"
+ /><rect x="411.0614" y="661.304" fill="none" width="49.2095" height="44.485" stroke="black"
+ /></g
+ ></g
+></svg
+>
Propchange: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/testChart.svg
------------------------------------------------------------------------------
svn:executable = *
Added: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/textGreek.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/textGreek.svg?rev=291451&view=auto
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/textGreek.svg (added)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/textGreek.svg Sun Sep 25 10:58:29 2005
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
+ 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
+<svg stroke-dasharray="none" shape-rendering="auto" xmlns="http://www.w3.org/2000/svg" font-family="'Arial'" width="960" text-rendering="auto" fill-opacity="1" contentScriptType="text/ecmascript" color-rendering="auto" color-interpolation="auto" preserveAspectRatio="xMidYMid meet" font-size="12" viewBox="0 0 960 720" fill="black" xmlns:xlink="http://www.w3.org/1999/xlink" stroke="black" image-rendering="auto" stroke-miterlimit="10" zoomAndPan="magnify" version="1.0" stroke-linecap="square" stroke-linejoin="miter" contentStyleType="text/css" font-style="normal" height="720" stroke-width="1" stroke-dashoffset="0" font-weight="normal" stroke-opacity="1"
+><!--Generated by the Batik Graphics2D SVG Generator--><defs id="genericDefs"
+ /><g
+ ><g fill="white" stroke-width="0.0756" stroke="white" stroke-linecap="butt" stroke-linejoin="round"
+ ><rect width="960" x="0" height="720" y="0" stroke="none"
+ /></g
+ ><g font-size="32" stroke-width="0.1667" font-family="'Courier New'" stroke-linecap="butt" stroke-linejoin="round"
+ ><text x="224" y="248" stroke="none"
+ >α</text
+ ></g
+ ></g
+></svg
+>
Propchange: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/transcoder/wmf/textGreek.svg
------------------------------------------------------------------------------
svn:executable = *
Modified: xmlgraphics/batik/branches/svg11/test-resources/org/apache/batik/transcoder/unitTesting.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-resources/org/apache/batik/transcoder/unitTesting.xml?rev=291451&r1=291450&r2=291451&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-resources/org/apache/batik/transcoder/unitTesting.xml (original)
+++ xmlgraphics/batik/branches/svg11/test-resources/org/apache/batik/transcoder/unitTesting.xml Sun Sep 25 10:58:29 2005
@@ -25,6 +25,15 @@
<!-- TranscoderInput Test -->
<!-- ================================================================== -->
-<test id="TranscoderInput" class="org.apache.batik.transcoder.TranscoderInputTest" />
+ <test id="TranscoderInput"
+ class="org.apache.batik.transcoder.TranscoderInputTest" />
+
+ <testGroup id="transcoder.WMFTranscoder"
+ class="org.apache.batik.transcoder.wmf.WMFAccuracyTest">
+ <test id="samples/tests/resources/wmf/black_shapes.wmf"/>
+ <test id="samples/tests/resources/wmf/imageWMF.wmf"/>
+ <test id="samples/tests/resources/wmf/testChart.wmf"/>
+ <test id="samples/tests/resources/wmf/textGreek.wmf"/>
+ </testGroup>
</testSuite>
Added: xmlgraphics/batik/branches/svg11/test-resources/org/apache/batik/transcoder/wmf/resources/Messages.properties
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-resources/org/apache/batik/transcoder/wmf/resources/Messages.properties?rev=291451&view=auto
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-resources/org/apache/batik/transcoder/wmf/resources/Messages.properties (added)
+++ xmlgraphics/batik/branches/svg11/test-resources/org/apache/batik/transcoder/wmf/resources/Messages.properties Sun Sep 25 10:58:29 2005
@@ -0,0 +1,58 @@
+###########################################################################
+# Copyright 1999-2003,2005 The Apache Software Foundation.
+###########################################################################
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+#
+# Error Messages values
+#
+WMFAccuracyTest.error.cannot.generate.svg = \
+Error while generating SVG with Painter : {0} \
+Got exception {1} with message {2} \
+and stack trace {3}
+
+WMFAccuracyTest.error.cannot.open.reference.svg.file = \
+Cannot open reference SVG file : {0} \
+Got IOException with message : {1}
+
+WMFAccuracyTest.error.while.comparing.files = \
+Error while comparing generated SVG and reference SVG {0}. \
+Got IOException with message : {1}
+
+WMFAccuracyTest.error.generated.svg.inaccurate = \
+Generated SVG is inaccurate.
+
+#
+# Entry Keys
+#
+WMFAccuracyTest.entry.key.error.description = \
+Error Description.
+
+WMFAccuracyTest.entry.key.line.number = \
+Line number
+
+WMFAccuracyTest.entry.key.column.number = \
+Column number
+
+WMFAccuracyTest.entry.key.column.expected.value = \
+Expected column value
+
+WMFAccuracyTest.entry.key.column.found.value = \
+Found column value
+
+WMFAccuracyTest.entry.key.reference.line = \
+Reference line
+
+WMFAccuracyTest.entry.key.new.line = \
+New line
Propchange: xmlgraphics/batik/branches/svg11/test-resources/org/apache/batik/transcoder/wmf/resources/Messages.properties
------------------------------------------------------------------------------
svn:executable = *
Modified: xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/svggen/AttributedCharacterIterator.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/svggen/AttributedCharacterIterator.java?rev=291451&r1=291450&r2=291451&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/svggen/AttributedCharacterIterator.java (original)
+++ xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/svggen/AttributedCharacterIterator.java Sun Sep 25 10:58:29 2005
@@ -53,21 +53,28 @@
//
// "Attributed" is in Bold
- styledText.addAttribute(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD, 0, 10);
+ styledText.addAttribute(TextAttribute.WEIGHT,
+ TextAttribute.WEIGHT_BOLD, 0, 10);
// "String" is italic
- // styledText.addAttribute(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE, 11, 18);
+ styledText.addAttribute(TextAttribute.POSTURE,
+ TextAttribute.POSTURE_OBLIQUE, 11, 18);
- // fun is Bold and underlined
- styledText.addAttribute(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON, 23, 28);
- // styledText.addAttribute(TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON);
- // styledText.addAttribute(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON, 23, 28);
+ // fun is Bold and underlined and strike through
+ styledText.addAttribute(TextAttribute.UNDERLINE,
+ TextAttribute.UNDERLINE_ON, 23, 28);
+ styledText.addAttribute(TextAttribute.STRIKETHROUGH,
+ TextAttribute.STRIKETHROUGH_ON, 23, 28);
+
+ // styledText.addAttribute(TextAttribute.SWAP_COLORS,
+ // TextAttribute.SWAP_COLORS_ON);
/*TextLayout aLayout = new TextLayout("A", font, frc);
Shape aShape = aLayout.getOutline(null);
ShapeGraphicAttribute aReplacement = new ShapeGraphicAttribute(aShape, GraphicAttribute.ROMAN_BASELINE, true);
- styledText.addAttribute(TextAttribute.CHAR_REPLACEMENT, aReplacement, 0, 1);
+ styledText.addAttribute(TextAttribute.CHAR_REPLACEMENT,
+ aReplacement, 0, 1);
// Create a BufferedImage to decorate the Shape
@@ -113,16 +120,26 @@
//
// "Attributed" is in dard red
- styledText.addAttribute(TextAttribute.FOREGROUND, new Color(128, 0, 0), 0, 10);
+ styledText.addAttribute(TextAttribute.FOREGROUND,
+ new Color(128, 0, 0), 0, 10);
// "String" is blue
- styledText.addAttribute(TextAttribute.FOREGROUND, new Color(70, 107, 132), 11, 18);
+ styledText.addAttribute(TextAttribute.FOREGROUND,
+ new Color(70, 107, 132), 11, 18);
- // "fun" is yellow on blue background
- styledText.addAttribute(TextAttribute.FOREGROUND, new Color(236, 214, 70), 23, 28);
- styledText.addAttribute(TextAttribute.BACKGROUND, new Color(70, 107, 132), 23, 28);
+ // "fun" is yellow
+ styledText.addAttribute(TextAttribute.FOREGROUND,
+ new Color(236, 214, 70), 23, 28);
java.text.AttributedCharacterIterator iter = styledText.getIterator();
+ g.drawString(iter, 10, 100);
+
+
+ // "fun" is now yellow on a blue background
+ styledText.addAttribute(TextAttribute.BACKGROUND,
+ new Color(70, 107, 132), 23, 28);
+
+ iter = styledText.getIterator();
/*TextLayout layout = new TextLayout(iter, frc);
Rectangle bounds = layout.getBounds().getBounds();
@@ -130,6 +147,6 @@
bounds.height += 50;
layout.draw(g, 25, layout.getAscent() + 25);*/
- g.drawString(iter, 10, 100);
+ g.drawString(iter, 10, 130);
}
}
Modified: xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/svggen/SVGAccuracyTest.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/svggen/SVGAccuracyTest.java?rev=291451&r1=291450&r2=291451&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/svggen/SVGAccuracyTest.java (original)
+++ xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/svggen/SVGAccuracyTest.java Sun Sep 25 10:58:29 2005
@@ -50,7 +50,7 @@
/**
* This test validates that a given rendering sequence, modeled
* by a <tt>Painter</tt> is properly converted to an SVG document
- * by comparing the generated SVG document to a know, valid
+ * by comparing the generated SVG document to a known, valid
* SVG reference.
*
* @author <a href="mailto:vhardy@apache.org">Vincent Hardy</a>
Added: xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/Messages.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/Messages.java?rev=291451&view=auto
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/Messages.java (added)
+++ xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/Messages.java Sun Sep 25 10:58:29 2005
@@ -0,0 +1,72 @@
+/*
+
+ Copyright 2001,2003 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ */
+package org.apache.batik.transcoder.wmf;
+
+import java.util.Locale;
+import java.util.MissingResourceException;
+
+import org.apache.batik.i18n.LocalizableSupport;
+
+/**
+ * This class manages the message for the test.wmf module.
+ *
+ * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
+ * @version $Id: Messages.java 201374 2004-08-18 07:17:26Z vhardy $
+ */
+public class Messages {
+
+ /**
+ * This class does not need to be instantiated.
+ */
+ protected Messages() { }
+
+ /**
+ * The error messages bundle class name.
+ */
+ protected final static String RESOURCES =
+ "org.apache.batik.transcoder.wmf.resources.Messages";
+
+ /**
+ * The localizable support for the error messages.
+ */
+ protected static LocalizableSupport localizableSupport =
+ new LocalizableSupport(RESOURCES);
+
+ /**
+ * Implements {@link org.apache.batik.i18n.Localizable#setLocale(Locale)}.
+ */
+ public static void setLocale(Locale l) {
+ localizableSupport.setLocale(l);
+ }
+
+ /**
+ * Implements {@link org.apache.batik.i18n.Localizable#getLocale()}.
+ */
+ public static Locale getLocale() {
+ return localizableSupport.getLocale();
+ }
+
+ /**
+ * Implements {@link
+ * org.apache.batik.i18n.Localizable#formatMessage(String,Object[])}.
+ */
+ public static String formatMessage(String key, Object[] args)
+ throws MissingResourceException {
+ return localizableSupport.formatMessage(key, args);
+ }
+}
Propchange: xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/Messages.java
------------------------------------------------------------------------------
svn:executable = *
Added: xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/WMFAccuracyTest.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/WMFAccuracyTest.java?rev=291451&view=auto
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/WMFAccuracyTest.java (added)
+++ xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/WMFAccuracyTest.java Sun Sep 25 10:58:29 2005
@@ -0,0 +1,400 @@
+/*
+
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+*/
+
+package org.apache.batik.transcoder.wmf;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.StringWriter;
+
+import org.apache.batik.util.SVGConstants;
+import org.apache.batik.test.AbstractTest;
+import org.apache.batik.test.DefaultTestReport;
+import org.apache.batik.test.TestReport;
+
+import org.apache.batik.transcoder.wmf.tosvg.WMFTranscoder;
+import org.apache.batik.transcoder.TranscoderInput;
+import org.apache.batik.transcoder.TranscoderOutput;
+
+/**
+ * This test validates that a given WMF file is properly converted to
+ * an SVG document by comparing the generated SVG document to a known,
+ * valid SVG reference.
+ *
+ * @author <a href="mailto:deweese@apache.org>deweese</a>
+ * @version $Id: skel.el,v 1.1 2003/05/13 21:04:46 deweese Exp $
+ */
+public class WMFAccuracyTest extends AbstractTest
+ implements SVGConstants {
+
+ public static final String GENERATOR_REFERENCE_BASE
+ = "test-references/org/apache/batik/transcoder/wmf";
+ public static final String CANDIDATE_REF_DIR = "candidate";
+
+ public static final String WMF_EXTENSION = ".wmf";
+ public static final String SVG_EXTENSION = ".svg";
+ public static final char PATH_SEPARATOR = '/';
+
+ /**
+ * Error when an error occurs while generating SVG
+ * with the <tt>SVGGraphics2D</tt>
+ * {0} = painter class name if painter not null. Null otherwise
+ * {1} = exception class name
+ * {2} = exception message
+ * {3} = exception stack trace.
+ */
+ public static final String ERROR_CANNOT_GENERATE_SVG
+ = "WMFAccuracyTest.error.cannot.generate.svg";
+
+ /**
+ * Error when the reference SVG file cannot be opened
+ * {0} = URI of the reference image
+ * {1} = IOException message
+ */
+ public static final String ERROR_CANNOT_OPEN_REFERENCE_SVG_FILE
+ = "WMFAccuracyTest.error.cannot.open.reference.svg.file";
+
+ /**
+ * Error when there is an IOException while comparing the
+ * reference SVG file with the newly generated SVG content
+ * {0} = URI of the reference image
+ * {1} = IOException message.
+ */
+ public static final String ERROR_ERROR_WHILE_COMPARING_FILES
+ = "WMFAccuracyTest.error.while.comparing.files";
+
+ /**
+ * Error when the generated SVG is inaccurate
+ */
+ public static final String ERROR_GENERATED_SVG_INACCURATE
+ = "WMFAccuracyTest.error.generated.svg.inaccurate";
+
+ public static final String ENTRY_KEY_ERROR_DESCRIPTION
+ = "WMFAccuracyTest.entry.key.error.description";
+
+ public static final String ENTRY_KEY_LINE_NUMBER
+ = "WMFAccuracyTest.entry.key.line.number";
+
+ public static final String ENTRY_KEY_COLUMN_NUMBER
+ = "WMFAccuracyTest.entry.key.column.number";
+
+ public static final String ENTRY_KEY_COLUMN_EXPECTED_VALUE
+ = "WMFAccuracyTest.entry.key.column.expected.value";
+
+ public static final String ENTRY_KEY_COLUMN_FOUND_VALUE
+ = "WMFAccuracyTest.entry.key.column.found.value";
+
+ public static final String ENTRY_KEY_REFERENCE_LINE
+ = "WMFAccuracyTest.entry.key.reference.line";
+
+ public static final String ENTRY_KEY_NEW_LINE
+ = "WMFAccuracyTest.entry.key.new.line";
+
+ public static final String REF_IMAGE_PREFIX
+ = "test-references/";
+
+ /**
+ * Painter which performs an arbitrary rendering
+ * sequence.
+ */
+ private URL wmfURL;
+
+ /**
+ * Reference SVG URL
+ */
+ private URL refURL;
+
+ /**
+ * File where the generated SVG might be saved
+ */
+ private File saveSVG;
+
+ protected String[] breakWMFFile(String wmfFile){
+ if(wmfFile == null) {
+ throw new IllegalArgumentException("Null WMF file given");
+ }
+
+ String [] ret = new String[3];
+
+ if (wmfFile.endsWith(WMF_EXTENSION)) {
+ ret[2] = WMF_EXTENSION;
+ } else {
+ throw new IllegalArgumentException
+ ("WMF File must end in '.wmf': " + wmfFile);
+ }
+
+ wmfFile = wmfFile.substring(0, wmfFile.length()-ret[2].length());
+
+ int fileNameStart = wmfFile.lastIndexOf(PATH_SEPARATOR);
+ String wmfDir = "";
+ if(fileNameStart != -1){
+ if(wmfFile.length() < fileNameStart + 2){
+ // Nothing after PATH_SEPARATOR
+ throw new IllegalArgumentException
+ ("Nothing after '"+PATH_SEPARATOR+"': " + wmfFile);
+ }
+ wmfDir = wmfFile.substring(0, fileNameStart + 1);
+ wmfFile = wmfFile.substring(fileNameStart + 1);
+ }
+ ret[0] = wmfDir;
+ ret[1] = wmfFile;
+ return ret;
+ }
+
+ /**
+ * Constructor
+ * @param painter the <tt>Painter</tt> object which will
+ * perform an arbitrary rendering sequence.
+ * @param refURL the location of a reference SVG which
+ * should be exactly identical to that generated
+ * by the painter.
+ */
+ public WMFAccuracyTest(){
+ }
+
+ public void setId(String id){
+ super.setId(id);
+ setFile(id);
+ }
+
+ public void setFile(String id) {
+ String wmfFile = id;
+
+ String[] dirNfile = breakWMFFile(wmfFile);
+
+ wmfURL = resolveURL(dirNfile[0]+dirNfile[1]+dirNfile[2]);
+ refURL = resolveURL
+ (GENERATOR_REFERENCE_BASE+"/"+dirNfile[1] +SVG_EXTENSION);
+ saveSVG = new File(GENERATOR_REFERENCE_BASE+"/"+CANDIDATE_REF_DIR+"/"+
+ dirNfile[1]+SVG_EXTENSION);
+ // System.err.println("WMFURL: " + wmfURL);
+ // System.err.println("REFURL: " + refURL);
+ // System.err.println("saveSVG: " + saveSVG);
+ }
+
+ /**
+ * Resolves the input string as follows.
+ * + First, the string is interpreted as a file description.
+ * If the file exists, then the file name is turned into
+ * a URL.
+ * + Otherwise, the string is supposed to be a URL. If it
+ * is an invalid URL, an IllegalArgumentException is thrown.
+ */
+ protected URL resolveURL(String url){
+ // Is url a file?
+ File f = (new File(url)).getAbsoluteFile();
+ if(f.getParentFile().exists()){
+ try{
+ return f.toURL();
+ }catch(MalformedURLException e){
+ throw new IllegalArgumentException();
+ }
+ }
+
+ // url is not a file. It must be a regular URL...
+ try{
+ return new URL(url);
+ }catch(MalformedURLException e){
+ throw new IllegalArgumentException(url);
+ }
+ }
+
+ public File getSaveSVG(){
+ return saveSVG;
+ }
+
+ public void setSaveSVG(File saveSVG){
+ this.saveSVG = saveSVG;
+ }
+
+ /**
+ * This method will only throw exceptions if some aspect
+ * of the test's internal operation fails.
+ */
+ public TestReport runImpl() throws Exception {
+ DefaultTestReport report = new DefaultTestReport(this);
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ try {
+ WMFTranscoder wmft = new WMFTranscoder();
+ TranscoderInput input;
+ input = new TranscoderInput(wmfURL.toString());
+
+ OutputStreamWriter outW;
+ outW = new OutputStreamWriter(out, "UTF-8");
+ TranscoderOutput output = new TranscoderOutput(outW);
+
+ wmft.transcode(input, output);
+ } catch(Exception e) {
+ StringWriter trace = new StringWriter();
+ e.printStackTrace(new PrintWriter(trace));
+ report.setErrorCode(ERROR_CANNOT_GENERATE_SVG);
+ String desc, msg;
+ desc = Messages.formatMessage(ENTRY_KEY_ERROR_DESCRIPTION, null);
+ msg = Messages.formatMessage(ERROR_CANNOT_GENERATE_SVG,
+ new String[]{ wmfURL.toString(),
+ e.getClass().getName(),
+ e.getMessage(),
+ trace.toString() });
+ report.setDescription(new TestReport.Entry[]{
+ new TestReport.Entry(desc, msg) });
+ report.setPassed(false);
+ return report;
+ }
+
+ BufferedReader genReader, refReader;
+ try {
+ InputStream is = refURL.openStream();
+ Reader r = new InputStreamReader(is);
+ refReader = new BufferedReader(r);
+ } catch (Exception e) {
+ report.setErrorCode(ERROR_CANNOT_OPEN_REFERENCE_SVG_FILE);
+ String desc, msg, refURLStr;
+ refURLStr = (refURL != null) ? refURL.toExternalForm() : "null";
+ desc = Messages.formatMessage(ENTRY_KEY_ERROR_DESCRIPTION, null);
+ msg = Messages.formatMessage(ERROR_CANNOT_OPEN_REFERENCE_SVG_FILE,
+ new Object[]{refURLStr,
+ e.getMessage()});
+ report.setDescription( new TestReport.Entry[]{
+ new TestReport.Entry(desc, msg) });
+ report.setPassed(false);
+ save(out.toByteArray());
+ return report;
+ }
+
+ byte[] data = out.toByteArray();
+ ByteArrayInputStream gen = new ByteArrayInputStream(data);
+ Reader r = new InputStreamReader(gen);
+ genReader = new BufferedReader(r);
+
+ try {
+ String refStr = refReader.readLine();
+ String genStr = genReader.readLine();
+ int line=1;
+ while ((refStr != null) && (genStr != null)) {
+
+ if (!refStr.equals(genStr))
+ break;
+
+ refStr = refReader.readLine();
+ genStr = genReader.readLine();
+ line++;
+ }
+ if ((refStr == null) && (genStr == null)) {
+ report.setPassed(true);
+ return report;
+ }
+
+ save(out.toByteArray());
+ int cn = computeColumnNumber(refStr, genStr);
+ String expectedChar = "<eol>";
+ if ((cn >= 0) && (refStr != null) && (refStr.length() > cn))
+ expectedChar = refStr.substring(cn, cn+1);
+
+ String foundChar = "<null>";
+ if((cn >=0) && (genStr != null) && (genStr.length() > cn))
+ foundChar = genStr.substring(cn, cn+1);
+
+ if (expectedChar.equals(" ")) expectedChar = "' '";
+ if (foundChar.equals(" ")) foundChar = "' '";
+
+ report.setErrorCode(ERROR_GENERATED_SVG_INACCURATE);
+ report.addDescriptionEntry(fmtMsg(ENTRY_KEY_LINE_NUMBER),
+ new Integer(line));
+ report.addDescriptionEntry(fmtMsg(ENTRY_KEY_COLUMN_NUMBER),
+ new Integer(cn));
+ report.addDescriptionEntry(fmtMsg(ENTRY_KEY_COLUMN_EXPECTED_VALUE),
+ expectedChar);
+ report.addDescriptionEntry(fmtMsg(ENTRY_KEY_COLUMN_FOUND_VALUE),
+ foundChar);
+ report.addDescriptionEntry(fmtMsg(ENTRY_KEY_REFERENCE_LINE),
+ refStr);
+ report.addDescriptionEntry(fmtMsg(ENTRY_KEY_NEW_LINE), genStr);
+ report.setPassed(false);
+ } catch (Exception e) {
+ String desc, msg;
+ desc = Messages.formatMessage(ENTRY_KEY_ERROR_DESCRIPTION, null);
+ msg = Messages.formatMessage(ERROR_ERROR_WHILE_COMPARING_FILES,
+ new Object[]{refURL.toExternalForm(),
+ e.getMessage()});
+ report.setErrorCode(ERROR_ERROR_WHILE_COMPARING_FILES);
+ report.setDescription(new TestReport.Entry[]{
+ new TestReport.Entry(desc, msg)});
+ report.setPassed(false);
+ save(out.toByteArray());
+ return report;
+ }
+ return report;
+ }
+
+
+
+ /**
+ * Saves the byte array in the "saveSVG" file
+ * if that file's parent directory exists.
+ */
+ protected void save(byte[] data) throws IOException{
+ if(saveSVG == null){
+ return;
+ }
+
+ FileOutputStream os = new FileOutputStream(saveSVG);
+ os.write(data);
+ os.close();
+ }
+
+ public int computeColumnNumber(String aStr, String bStr){
+ if(aStr == null || bStr == null){
+ return -1;
+ }
+
+ int n = aStr.length();
+ int i = -1;
+ for(i=0; i<n; i++){
+ char a = aStr.charAt(i);
+ if(i < bStr.length()){
+ char b = bStr.charAt(i);
+ if(a != b){
+ break;
+ }
+ }
+ else {
+ break;
+ }
+ }
+
+ return i;
+ }
+
+ protected String fmtMsg(String str) {
+ return Messages.formatMessage(str, null);
+ }
+
+};
Propchange: xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/transcoder/wmf/WMFAccuracyTest.java
------------------------------------------------------------------------------
svn:executable = *