title: align text using drawInRect:withAttributes:
body: <p>In the iOS 5 version of my app I had:</p>
  
  <pre><code>[self.text drawInRect: stringRect
               withFont: [UIFont fontWithName: @"Courier" size: kCellFontSize]
          lineBreakMode: NSLineBreakByTruncatingTail
              alignment: NSTextAlignmentRight];
  </code></pre>
  
  <p>I'm upgrading for iOS 7. The above method is deprecated. I'm now using <em>drawInRect:withAttributes:</em>. The <em>attributes</em> parameter is an NSDictionary object. I can get <em>drawInRect:withAttributes:</em> to work for the former <em>font</em> parameter using this:</p>
  
  <pre><code>      UIFont *font = [UIFont fontWithName: @"Courier" size: kCellFontSize];
  
        NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: font, NSFontAttributeName,
                                    nil];
  
        [self.text drawInRect: stringRect
               withAttributes: dictionary];
  </code></pre>
  
  <p>What key-value pairs do I add to <em>dictionary</em> to get <em>NSLineBreakByTruncatingTail</em> and <em>NSTextAlignmentRight</em>?</p>