text-direction-worker.js (362B)
1 self.onmessage = function(e) { 2 offscreen = e.data.canvas; 3 offscreen_ctx = offscreen.getContext("2d"); 4 5 offscreen_ctx.font = "25px serif"; 6 offscreen_ctx.direction = "rtl"; 7 offscreen_ctx.fillText("ABC!", 60, 50); 8 9 // Fill a pixel, used to detect when the worker has completed. 10 offscreen_ctx.fillStyle = '#0f0'; 11 offscreen_ctx.fillRect(0, 0, 1, 1); 12 }