title: CGContext set text to justify right when generating a pdf
body: <p>I'm using a series of CGContext commands to create text to be used for generating a pdf file:</p>
  
  <pre><code>CGContextSelectFont (pdfContext, "Helvetica", 14, kCGEncodingMacRoman);
  CGContextSetTextDrawingMode (pdfContext, kCGTextFill);
  CGContextSetRGBFillColor (pdfContext, 0, 0, 0, 1);
  CGContextSetTextMatrix(pdfContext, CGAffineTransformMake(1.0,0.0, 0.0, -1.0, 0.0, 0.0));
  </code></pre>
  
  <p>I would like to <strong>right justify the text</strong> though. Any idea on how to do this? For example, is there a method that allows you to specify the origin as the top right corner of the text, not the top left?</p>
  
  <pre><code>    CGContextShowTextAtPoint (pdfContext, x, y, text, strlen(text));
  </code></pre>
  
  <p>Thanks!</p>