Debian Codegraph @

dojox/gfx/tests/_gfxBidiSupport/silverlight/textBidiSilverlight.html

raw symbols SCIP
1 <html>
2 <head>
3 <title>Testing text</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <style type="text/css">
6 @import "../../../../../dojo/resources/dojo.css";
7 @import "../../../../../dijit/tests/css/dijitTests.css";
8 </style>
9 <script type="text/javascript" src="../../../../../dojo/dojo.js" data-dojo-config="isDebug: true, gfxRenderer:'silverlight'"></script>
10
11 <script type="text/javascript">
12 dojo.require("dojox.gfx");
13 dojo.require("dojox.gfx._gfxBidiSupport");
14
15 var ROTATION = 30;
16
17 var surface = null, t1, t2, t3, t4, t5;
18
19 var placeAnchor = function(surface, x, y){
20 surface.createLine({x1: x - 2, y1: y, x2: x + 2, y2: y});
21 surface.createLine({x1: x, y1: y - 2, x2: x, y2: y + 2});
22 };
23
24 var makeText = function(surface, text, font, fill, stroke){
25 var t = surface.createText(text);
26 if(font) t.setFont(font);
27 if(fill) t.setFill(fill);
28 if(stroke) t.setStroke(stroke);
29 placeAnchor(surface, text.x, text.y);
30 return t;
31 };
32
33 makeShapes = function(){
34 surface = dojox.gfx.createSurface("test", 700, 500);
35 var m = dojox.gfx.matrix;
36 //surface.createLine({x1: 250, y1: 0, x2: 250, y2: 500}).setStroke("green");
37 t1 = makeText(surface, {id: "t1",x: 250, y: 50, text: "1.) \u05e9\u05dc\u05d5\u05dd world LTR!", textDir:"ltr"},
38 {family: "Times", size: "24pt"}, "black", "red")
39 .setTransform(m.rotategAt(0, 250, 50));
40
41 t2 = makeText(surface, {x: 250, y: 100, text: "2.) Hello \u05e2\u05d5\u05dc\u05dd LTR!", textDir:"ltr"},
42 {family: "Times", size: "24pt"}, "black", "red")
43 .setTransform(m.rotategAt(0, 250, 100));
44
45 t3 = makeText(surface, {x: 250, y: 150, text: "3.)\u05e9\u05dc\u05d5\u05dd world RTL!", textDir:"rtl"},
46 {family: "Times", size: "24pt"}, "red", "black")
47 .setTransform(m.rotategAt(0, 250, 150));
48 t4 = makeText(surface, {x: 250, y: 200, text: "4.) Hello \u05e2\u05d5\u05dc\u05dd RTL!", kerning: true,textDir:"rtl"},
49 {family: "Times", size: "24pt"}, "red", "black")
50 .setTransform(m.rotategAt(0, 250, 200));
51 t5 = makeText(surface, {x: 250, y: 250, text: "5.) \u05e9\u05dc\u05d5\u05dd world AUTO!", kerning: false,textDir:"auto"},
52 {family: "Times", size: "24pt"}, "red", "black")
53 .setTransform(m.rotategAt(0, 250, 250));
54 t6 = makeText(surface, {x: 250, y: 300, text: "6.) Hello \u05e2\u05d5\u05dc\u05dd AUTO!", kerning: false,textDir:"auto"},
55 {family: "Times", size: "24pt"}, "black", "red")
56 .setTransform(m.rotategAt(0, 250, 300));
57 };
58
59 dojo.addOnLoad(makeShapes);
60
61 </script>
62 </head>
63 <body>
64 <h1>dojox.gfx Text test</h1>
65 <div id="test" style="width: 700px; height: 500px;"></div>
66
67
68 </body>
69 </html>