title: CGContextShowTextAtPoint renders upside down
body: <p>I am trying to draw some text via <code>Quartz</code> onto an <code>NSView</code> via <code>CGContextShowTextAtPoint()</code>.  This worked well until I overrode <code>(BOOL)isFlipped</code> to return <code>YES</code> in my <code>NSView</code> subclass in order to position the origin in the upper-left for drawing.  The text draws in the expected area but the letters are all inverted.  I also tried the (theoretically, at least) equivalent of flipping my CGContext and translating by the context's height.</p>
  
  <p>e.x.</p>
  
  <pre><code>// drawRect:
  CGContextScaleCTM(theContext, 1, -1);
  CGContextTranslateCTM(theContext, 0, -dirtyRect.size.height);
  </code></pre>
  
  <p>This yields the same result.  </p>
  
  <p>Many suggestions to similar problems have pointed to modifying the text matrix.  I've set the text matrix to the identity matrix, performed an additional inversion on it, and done both, respectively.  All these solutions have lead to even stranger rendering of the text (often just a fragment shows up.)</p>
  
  <p>Another suggestion I saw was to simply steer clear of this function in favor of other means of drawing text (e.x. <code>NSString</code>'s drawing methods.)  However, this is being done amongst mostly C++ / C and I'd like to stay at those levels if possible.</p>
  
  <p>Any suggestions are much appreciated and I'd be happy to post more code if needed.  </p>
  
  <p>Thanks, 
  Sam</p>