title: NSAttributedString text position
body: <p>I sub-classed a <code>UILabel</code>, so I can use this <code>TitleLabel</code> on several places. This <code>TitleLabel</code> has a custom font. The <code>lineheight</code> is set with an <code>NSAttributedString</code>.</p>
  
  <p><strong>This is the <code>drawTextInRect</code> override method:</strong></p>
  
  <pre><code>- (void)drawTextInRect:(CGRect)rect {
      self.text = @"THIS IS A TEST";
      NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:self.text];
  
      NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
      paragraphStyle.minimumLineHeight = 15.f;
      paragraphStyle.maximumLineHeight = 15.f;
  
      [attStr addAttribute:NSBackgroundColorAttributeName value:[UIColor yellowColor] range:NSMakeRange(0,7)];
      [attStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, self.text.length)];
      [attStr addAttribute:NSFontAttributeName value:[UIFont fontWithName:TITLE_FONT_NAME size:TITLE_FONT_SIZE] range:NSMakeRange(0, self.text.length)];
  
      self.attributedText = attStr;
  
      [super drawTextInRect:rect];
  }
  </code></pre>
  
  <p>The background colors are added for test purposes. As you can see, the yellow background color has the right position. The text <strong>THIS IS</strong> should be in the yellow background, but is positioned above the background.
  <code>TITLE_FONT_SIZE</code> is <code>15</code>, defined somewhere else.</p>
  
  <p><img src="https://i.stack.imgur.com/1rLMk.png" alt="enter image description here"></p>
  
  <p>Anyone knows why this happens?</p>