OLD | NEW |
1 <?xml version="1.0" encoding="utf-8"?> | 1 <?xml version="1.0" encoding="utf-8"?> |
2 <svg width="100%" height="100%" viewBox="0 0 480 360" xmlns="http://www.w3.org/
2000/svg"> | 2 <svg width="100%" height="100%" viewBox="0 0 480 360" xmlns="http://www.w3.org/
2000/svg"> |
3 <g font-family="Arial" font-size="18"> | 3 <g font-family="Arial" font-size="18"> |
4 <text x="10" y="50"><tspan direction="ltr" unicode-bidi="bidi-override">نشاط
التدويل، W3C</tspan></text> | 4 <text x="10" y="50"><tspan direction="ltr" unicode-bidi="bidi-override">نشاط
التدويل، W3C</tspan></text> |
5 <text x="10" y="80"><tspan direction="ltr" unicode-bidi="normal">نشاط التدوي
ل، W3C</tspan></text> | 5 <text x="10" y="80"><tspan direction="ltr" unicode-bidi="normal">نشاط التدوي
ل، W3C</tspan></text> |
| 6 <text x="10" y="110" text-anchor="end" direction="rtl">W3C <tspan>نشاط التدو
يل،</tspan></text> |
6 <g id="container"/> | 7 <g id="container"/> |
7 | 8 |
8 <script type="text/javascript"><![CDATA[ | 9 <script type="text/javascript"><![CDATA[ |
9 function highlightGlyph(text, index, color) { | 10 function highlightGlyph(text, index, color) { |
10 var extent = text.getExtentOfChar(index); | 11 var extent = text.getExtentOfChar(index); |
11 | 12 |
12 // Highlight rect that we've selected using the extent information | 13 // Highlight rect that we've selected using the extent information |
13 var rectElement = document.createElementNS("http://www.w3.org/2000/s
vg", "rect"); | 14 var rectElement = document.createElementNS("http://www.w3.org/2000/s
vg", "rect"); |
14 rectElement.setAttribute("x", extent.x); | 15 rectElement.setAttribute("x", extent.x); |
15 rectElement.setAttribute("y", extent.y); | 16 rectElement.setAttribute("y", extent.y); |
(...skipping 19 matching lines...) Expand all Loading... |
35 var textElements = document.querySelectorAll("text"); | 36 var textElements = document.querySelectorAll("text"); |
36 for (var elemNum = 0; elemNum < textElements.length; ++elemNum) { | 37 for (var elemNum = 0; elemNum < textElements.length; ++elemNum) { |
37 var text = textElements[elemNum]; | 38 var text = textElements[elemNum]; |
38 var charCount = text.getNumberOfChars(); | 39 var charCount = text.getNumberOfChars(); |
39 for (var index = 0; index < charCount; ++index) | 40 for (var index = 0; index < charCount; ++index) |
40 highlightGlyph(text, index, colors[index % colors.length]); | 41 highlightGlyph(text, index, colors[index % colors.length]); |
41 } | 42 } |
42 ]]></script> | 43 ]]></script> |
43 </g> | 44 </g> |
44 </svg> | 45 </svg> |
OLD | NEW |