text-dom-02-f-isvalid.html (4178B)
1 <!DOCTYPE html> 2 <html lang='en'> 3 <head> 4 <title>text-dom-02-f-manual.svg</title> 5 <meta charset='utf-8'> 6 </head> 7 <body> 8 <h1>Source SVG: text-dom-02-f-manual.svg</h1> 9 <svg version="1.1" baseProfile="full" 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: text-dom-02-f.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 <text x='10' y='30' font-size='13'>Test that SVGTextContentElement methods work on UTF-16 code units</text> 32 <text x='10' y='60' font-size='11'>Methods independent of layout</text> 33 <font-face font-family='SPlaneOne'> 34 <font-face-src> 35 <font-face-uri xlink:href="../resources/Plane1/PlaneOne.svg#SPlaneOne"/> 36 </font-face-src> 37 </font-face> 38 <style> 39 @font-face { 40 font-family: PlaneOne; 41 src: url(woffs/PlaneOne.woff) format("woff"); 42 } 43 </style> 44 45 <text id='t' x='50' y='50' visibility='hidden' font-family='PlaneOne, SPlaneOne, serif' font-size='10' rotate='10 20 30'>a𐀀b</text> 46 47 <rect id='r1' x='10' y='140' width='30' height='30'/> 48 <text x='50' y='160'>getNumberOfChars</text> 49 50 <rect id='r2' x='10' y='180' width='30' height='30'/> 51 <text x='50' y='200'>getSubStringLength</text> 52 53 <script><![CDATA[ 54 function $(x) { return document.getElementById(x) } 55 function eq(a, b) { 56 if (a.length != b.length) return false; 57 for (var i = 0; i < a.length; i++) if (a[i] != b[i]) return false; 58 return true; 59 } 60 function p(x, y) { 61 var p = document.documentElement.createSVGPoint(); 62 p.x = x; 63 p.y = y; 64 return p; 65 } 66 67 var t = $('t'); 68 var x, b; 69 70 b = false; 71 try { 72 b = t.getNumberOfChars() == 4; 73 } catch (e) { 74 } 75 $('r1').setAttribute('fill', b ? 'green' : 'red'); 76 77 b = false; 78 try { 79 x = [ 80 t.getSubStringLength(0, 1), 81 t.getSubStringLength(0, 2), 82 t.getSubStringLength(0, 3), 83 t.getSubStringLength(0, 4), 84 t.getSubStringLength(1, 1), 85 t.getSubStringLength(1, 2), 86 t.getSubStringLength(1, 3), 87 t.getSubStringLength(2, 1), 88 t.getSubStringLength(2, 2), 89 t.getSubStringLength(3, 1), 90 ]; 91 b = eq(x, [1, 3, 3, 7, 2, 2, 6, 2, 6, 4]); 92 } catch (e) { 93 } 94 $('r2').setAttribute('fill', b ? 'green' : 'red'); 95 96 ]]></script> 97 </g> 98 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 99 <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.10 $</text> 100 </g> 101 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> 102 <!-- comment out this watermark once the test is approved --><!-- 103 <g id="draft-watermark"> 104 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> 105 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" 106 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> 107 </g>--> 108 </svg> 109 </body> 110 </html>