title: How to make NSStringDrawingContext shrink text?
body: <p>I'm trying to use the attributed string API of iOS 6 to calculate the size of text and shrink the font size if necessary. However, I can't get it to work as the documentation says.</p>
  
  <pre><code>NSString *string = @"This is a long text that doesn't shrink as it should";
  
  NSStringDrawingContext *context = [NSStringDrawingContext new];
  context.minimumScaleFactor = 0.5;
  
  UIFont *font = [UIFont fontWithName:@"SourceSansPro-Bold" size:32.f];
  
  NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
  paragraphStyle.lineBreakMode = NSLineBreakByClipping;
  
  NSDictionary *attributes = @{ NSFontAttributeName: font,
                                NSParagraphStyleAttributeName: paragraphStyle };
  
  NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:self.title attributes:attributes];
  
  CGRect rect = [attributedString boundingRectWithSize:CGSizeMake(512.f, 512.f) options:NSStringDrawingUsesLineFragmentOrigin context:context];
  
  NSLog(@"rect: %@, context: %@", NSStringFromCGRect(rect), context.debugDescription);
  </code></pre>
  
  <p>But the text doesn't shrink and is truncated. <code>actualScaleFactor</code> is always <code>1</code>. The log results are:</p>
  
  <pre><code>rect:{{0, 0}, {431.64801, 80.447998}}, context:&lt;NSStringDrawingContext: 0x14e85770&gt; minimumScaleFactor:0.500000 minimumTrackingAdjustment:0.000000 actualScaleFactor:1.000000 actualTrackingAdjustment:0.000000 totalBounds:{{0, 0}, {431.64801, 80.447998}}
  </code></pre>
  
  <p>The result is the same if I use the actual drawing method and not the measuring method. If I remove the paragraph style, it makes the text wrap and doesn't shrink it. If I remove the paragraph style AND I choose a size that only allows one line of text, the text is truncated too instead of being shrunk. What is wrong? There is very little documentation or online resources dealing with <code>NSStringDrawingContext</code>. And I'm trying to avoid the use of <code>sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:</code> which is deprecated in iOS 7. </p>