While this is similar to the previous answer, it adds a bit (hopefully).
Basically, I want to clarify that we usually think of drawing things like draw a rectangle at 10, 3 .
So, if we think about it this way: move origin to 10, 3 , then draw rectangle at 0, 0 . Then all we need to do is add a twist between them.
Another important point is the alignment of the text. The easiest way is to draw the text at 0, 0, so using the right alignment can allow us to do this without measuring the width of the text.
We still have to move the text a size to get it centered vertically, and unfortunately the canvas does not have much support for the line height, so guess and check the thing (correct me if something is better).
I created 3 examples that provide a dot and text with three alignments to show at which actual point the font will be displayed on the screen.

var font, lineHeight, x, y; x = 100; y = 100; font = 20; lineHeight = 15; // this is guess and check as far as I know this.context.font = font + 'px Arial'; // Right Aligned this.context.save(); this.context.translate(x, y); this.context.rotate(-Math.PI / 4); this.context.textAlign = 'right'; this.context.fillText('right', 0, lineHeight / 2); this.context.restore(); this.context.fillStyle = 'red'; this.context.fillRect(x, y, 2, 2); // Center this.context.fillStyle = 'black'; x = 150; y = 100; this.context.save(); this.context.translate(x, y); this.context.rotate(-Math.PI / 4); this.context.textAlign = 'center'; this.context.fillText('center', 0, lineHeight / 2); this.context.restore(); this.context.fillStyle = 'red'; this.context.fillRect(x, y, 2, 2); // Left this.context.fillStyle = 'black'; x = 200; y = 100; this.context.save(); this.context.translate(x, y); this.context.rotate(-Math.PI / 4); this.context.textAlign = 'left'; this.context.fillText('left', 0, lineHeight / 2); this.context.restore(); this.context.fillStyle = 'red'; this.context.fillRect(x, y, 2, 2);
String this.context.fillText('right', 0, lineHeight / 2); basically 0, 0 , except that we move a bit so that the text is centered near the point