coords-units-02-b-isvalid.html (6708B)
1 <!DOCTYPE html> 2 <html lang='en'> 3 <head> 4 <title>coords-units-02-b-manual.svg</title> 5 <meta charset='utf-8'> 6 </head> 7 <body> 8 <h1>Source SVG: coords-units-02-b-manual.svg</h1> 9 <svg version="1.1" baseProfile="basic" id="svg-root" 10 width="100%" height="100%" viewBox="0 0 480 360" 11 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 12 <!--======================================================================--> 13 <!--= SVG 1.1 2nd Edition Test Case =--> 14 <!--======================================================================--> 15 <!--= Copyright 2009 World Wide Web Consortium, (Massachusetts =--> 16 <!--= Institute of Technology, European Research Consortium for =--> 17 <!--= Informatics and Mathematics (ERCIM), Keio University). =--> 18 <!--= All Rights Reserved. =--> 19 <!--= See http://www.w3.org/Consortium/Legal/. =--> 20 <!--======================================================================--> 21 22 <title id="test-title">$RCSfile: coords-units-02-b.svg,v $</title> 23 <defs> 24 <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> 25 <font-face-src> 26 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> 27 </font-face-src> 28 </font-face> 29 </defs> 30 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> 31 <g font-size="13pt"> 32 <!-- ==================================================================== --> 33 <!-- First test, converting CSS coordinates to user space. --> 34 <!-- If implemented properly, the pink marker should appear on top of --> 35 <!-- the black marker. --> 36 <!-- ==================================================================== --> 37 <!-- Draw Text Comment --> 38 <text x="60" y="35">CSS pixel coordinate to user space conversion</text> 39 <g transform="translate(5, 0) scale(4)"> 40 <!-- Draw marker using user space units --> 41 <circle cx="7.5" cy="7.5" r="2.5" fill="black"/> 42 <!-- Draw CSS marker using px units --> 43 <circle cx="7.5px" cy="7.5px" r="1.5px" fill="fuchsia"/> 44 </g> 45 <!-- ==================================================================== --> 46 <!-- Same test, using percentage values for the coordinates --> 47 <!-- ==================================================================== --> 48 <!-- Draw Text Comment --> 49 <text x="60" y="85">Percentage coordinates to user space conversion</text> 50 <g transform="translate(5, 50) scale(4)"> 51 <!-- Draw marker using user space units --> 52 <circle cx="7.5" cy="7.5" r="2.5" fill="black"/> 53 <!-- Draw marker using percentages: 7.5 = 1.563% of 480 (cx) --> 54 <!-- Draw marker using percentages: 7.5 = 2.083% of 360 (cy) --> 55 <circle cx="1.563%" cy="2.083%" r=".3535%" fill="fuchsia"/> 56 </g> 57 <!-- ==================================================================== --> 58 <!-- Second test, converting CSS width and height to user space. --> 59 <!-- If implemented properly, the link marker should appear bellow the --> 60 <!-- black one and have the same size --> 61 <!-- ==================================================================== --> 62 <!-- Draw Text Comment --> 63 <text x="60" y="140">CSS width/height to user space conversion</text> 64 <g transform="translate(30, 115) scale(4)"> 65 <!-- Draw marker using user space units --> 66 <rect x="-5" y="0" width="10" height="5" fill="black"/> 67 <!-- Draw CSS marker using px units --> 68 <rect x="-5" y="5" width="10px" height="5px" fill="fuchsia"/> 69 </g> 70 <!-- ==================================================================== --> 71 <!-- Same test, using percentage values for the length --> 72 <!-- ==================================================================== --> 73 <!-- Draw Text Comment --> 74 <text x="60" y="200">Percentage width/height to user space conversion</text> 75 <g transform="translate(30, 175) scale(4)"> 76 <!-- Draw marker using user space units --> 77 <rect x="-5" y="0" width="10" height="5" fill="black"/> 78 <!-- Draw CSS marker using percentages: 5*2 = 10 = 2.083% of 480 --> 79 <!-- 2.5*2 = 5 = 1.389% of 360 --> 80 <rect x="-5" y="5" width="2.083%" height="1.389%" fill="fuchsia"/> 81 </g> 82 <!-- ==================================================================== --> 83 <!-- Third test, converting CSS arbitrary length to user space . --> 84 <!-- If implemented properly, the three circles which are side by side --> 85 <!-- should have the same radius --> 86 <!-- ==================================================================== --> 87 <!-- Draw Text Comment --> 88 <text x="140" y="265">CSS and percentage length conversion</text> 89 <g transform="translate(30, 260) skewX(45) scale(4)"> 90 <!-- Draw marker using user space units --> 91 <circle cx="0" cy="0" r="3.536" fill="black"/> 92 <!-- Draw CSS marker using px units. --> 93 <circle cx="10" cy="0" r="3.536px" fill="fuchsia"/> 94 <!-- Draw marker using percentages. This should yield a value of 3.536 --> 95 <!-- in user space. 3.536 = .8334% of 424.268px --> 96 <circle cx="20" cy="0" r=".8334%" fill="green"/> 97 <!-- Draw control lines at the top and bottom of the circles --> 98 <line x1="-3.536" y1="-3.536" x2="25" y2="-3.536" fill="none" stroke="#cccccc" stroke-width=".5"/> 99 <line x1="-3.536" y1="3.536" x2="25" y2="3.536" fill="none" stroke="#cccccc" stroke-width=".5"/> 100 </g> 101 </g> 102 </g> 103 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 104 <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.8 $</text> 105 </g> 106 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> 107 <!-- comment out this watermark once the test is approved --> 108 <!--<g id="draft-watermark"> 109 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> 110 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" 111 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> 112 </g>--> 113 </svg> 114 </body> 115 </html>