Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / svg / custom / js-font-test.svg-disabled
blob8c627d769f7fd9ec5602d95f267e409193c66cf1
1 <?xml version="1.0" encoding="UTF-8"?>
2 <svg width="800" height="1000" xmlns="http://www.w3.org/2000/svg" onload="init()">
3 <script language="JavaScript">
4 var fontFamily1 = "Arial";
5 var fontFamily2 = "LucidaSansUnicode";
6 var fontFamily3 = "MS-Gothic";
8 var entryYOffset = 10;
9 var entryYDelta = 16;
11 var entryX = new Array();
12 entryX[0] = 10;
13 entryX[1] = 100;
14 entryX[2] = 190;
16 var entryXEnd = entryX[0] + entryX[1] + entryX[2];
18 var entryY = new Array();
19 entryY[0] = entryYOffset;
20 entryY[1] = entryYOffset;
21 entryY[2] = entryYOffset;
23 var insert;
25 function drawGrid(xValue, yValue)
27 var line = document.createElement("line");
28 line.x1.baseVal.value = Math.floor(xValue);
29 line.y1.baseVal.value = Math.floor(yValue) + (entryYDelta / 2) - 4;
30 line.x2.baseVal.value = Math.floor(xValue) + entryXEnd;
31 line.y2.baseVal.value = Math.floor(yValue) + (entryYDelta / 2) - 4;
32 line.setAttribute("style", "stroke-width:1px; stroke:black; opacity:0.5");
34 insert.appendChild(line);
37 function entry(message, xValue, yValue, family)
39 var text = document.createElement("text");
41 // Set X/Y properties using SVG DOM
42 var xLength = document.rootElement.createSVGLength();
43 xLength.value = xValue;
45 var yLength = document.rootElement.createSVGLength();
46 yLength.value = yValue;
48 text.x.baseVal.appendItem(xLength);
49 text.y.baseVal.appendItem(yLength);
51 // Append "Text" child node
52 text.appendChild(document.createTextNode(message));
54 // Choose font-size/font-family
55 switch (family) {
56 case 0:
57 text.setAttribute("font-family", fontFamily1);
58 break;
59 case 1:
60 text.setAttribute("font-family", fontFamily2);
61 break;
62 case 2:
63 text.setAttribute("font-family", fontFamily3);
64 break;
67 text.setAttribute("font-size", "12");
69 // Add to tree
70 insert.appendChild(text);
71 return entryYDelta;
74 function newEntry(col1, col2, col3, family)
76 drawGrid(entryX[0], entryY[0]);
78 entryY[0] += entry(col1, entryX[0], entryY[0], family);
79 entryY[1] += entry(col2, entryX[1], entryY[1], family);
80 entryY[2] += entry(col3, entryX[2], entryY[2], family);
83 function init()
85 insert = document.getElementById("insert");
87 newEntry("Arabic", "", "السلام عليكم ", 0);
88 newEntry("Bengali", "বাঙ্লা", "ষাগতোম", 0); // Which lang?
89 newEntry("Burmese", "", "မ္ရန္မာ", 0); // Which lang?
90 newEntry("Cherokee", "ᏣᎳᎩ", "ᎣᏏᏲ", 0); // Which lang?
91 newEntry("Czech", "česky", "Dobrý den", 0);
92 newEntry("Danish", "Dansk", "Hej, Goddag", 0);
93 newEntry("English", "", "Hello", 0);
94 newEntry("Esperanto", "", "Saluton", 0);
95 newEntry("Estonian", "", "Tere, Tervist", 0);
96 newEntry("Finnish", "Suomi", "Hei", 0);
97 newEntry("French", "Français", "Bonjour, Salut", 0);
98 newEntry("German", "Deutsch Nord", "Guten Tag", 0);
99 newEntry("German", "Deutsch Süd", "Grüß Gott", 0);
100 newEntry("Georgian", "ქართველი", "გამარჯობა", 0); // Which lang?
101 newEntry("Gujarati", "", "ગુજરાતિ", 0); // Which lang?
102 newEntry("Greek", "Ελληνικά", "Γειά σας", 0);
103 newEntry("Hebrew", "", "שלום", 1);
104 newEntry("Hindi", "", "नमस्ते, नमस्कार।", 0); // Which lang?
105 newEntry("Italiano", "", "Ciao, Buon giorno", 0);
106 newEntry("ɪŋglɪʃ", "", "hɛləʊ", 1); // Which lang here?
107 newEntry("Maltese", "", "Ċaw, Saħħa", 1);
108 newEntry("Nederlands", "", "Hallo, Dag", 0);
109 newEntry("Norwegian", "Norsk", "Hei, God dag", 0);
110 newEntry("Punjabi", "", "ੁਪੁਂਜਾਬਿ", 0); // Which lang?
111 newEntry("Polish", "", "Dzień dobry, Hej", 0);
112 newEntry("Russian", "Русский", "Здравствуйте!", 0);
113 newEntry("Slovak", "", "Dobrý deň", 0);
114 newEntry("Spanish", "Español", "‎¡Hola!‎", 1);
115 newEntry("Swedish", "Svenska", "Hej, Goddag", 0);
116 newEntry("Thai", "ภาษาไทย", "สวัสดีครับ, สวัสดีค่ะ", 0); // Which lang?
117 newEntry("Turkish", "Türkçe", "Merhaba", 0);
118 newEntry("Vietnamese", "Tiếng Việt", "Xin Chào", 0);
119 newEntry("Yiddish", "ײַדישע", "דאָס הײַזעלע ", 1);
120 newEntry("Japanese", "日本語", "こんにちは, コンニチハ", 2);
121 newEntry("Chinese", "中文,普通è¯�,汉语½", "你好", 2);
122 newEntry("Cantonese", "粵語,廣東話", "早晨, 你好", 2);
123 newEntry("Korean", "한글", "안녕하세요, 안녕하십니까", 0); // Which lang?
125 </script>
127 <g id="insert"/>
128 </svg>