title: Placing text label along a line on a canvas
body: <p>I managed to draw a line on a canvas using html5:</p>
  
  <pre><code>ctx.moveTo(x1, y1);
  ctx.lineTo(x2, y2);
  ctx.stroke();
  </code></pre>
  
  <p>This works.  I now want to "annotate" the line with text.  So basically, I want there to be custom (e.g. whatever I pass in) text appearing along the length of the line.  The difficulty is that the line can appear in any orientation (e.g. have any slope) so the text needs to be oriented accordingly.  Any ideas how to start?</p>