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