canvas.2d.direction.dynamic-ref.html (598B)
1 <!doctype HTML> 2 <meta charset="utf-8"> 3 <title>HTML5 Canvas Test Reference: The direction attribute.</title> 4 <link rel="author" href="mailto:schenney@chromium.org"/> 5 <script> 6 function runTest() 7 { 8 var canvas = document.getElementById("canvas1"); 9 var ctx = canvas.getContext("2d"); 10 11 ctx.font = "25px serif"; 12 ctx.direction = "rtl"; 13 ctx.fillText("ABC!", 60, 50); 14 15 ctx.direction = "ltr"; 16 ctx.fillText("ABC!", 60, 100); 17 } 18 </script> 19 <body onload="runTest()"> 20 <canvas id="canvas1" width="300" height="150"> 21 Browser does not support HTML5 Canvas. 22 </canvas> 23 </body>