title: NSAttributedString reporting incorrect sizes for UITextView sizeThatFits and boundingRectWithSize with correct options set
body: <p>I have an NSAttributedString that is reporting a boundingRectWithSize (and by extension a UITextView which improperly calculates its sizeThatFits) when the font size is decreased from the font size that was used to create it.</p>
  
  <p>It doesn't happen on all NSAttributedStrings for which I do similar operations, so here's the steps to reproduce.</p>
  
  <ol>
  <li>Use a non-standard font that does not include the full unicode character set.</li>
  <li>Make sure the string includes characters in this "unsupported" set.  iOS will render them as Helvetica in the proper size.</li>
  <li>Scale your font down on all font attributes in your NSAttributedString.  My code for doing so that produced the issue looks like this.</li>
  </ol>
  
  <p>From inside a UITextView subclass:</p>
  
  <pre><code>NSMutableAttributedString *mutableString = [self.attributedText mutableCopy];
  [mutableString enumerateAttribute:NSFontAttributeName inRange:NSMakeRange(0, mutableString.length) options:0 usingBlock:^(id value, NSRange range, BOOL *stop) {
      if (value) {
          UIFont *oldFont = (UIFont *)value;
          UIFont *newFont = [oldFont fontWithSize:oldFont.pointSize - 1];
          [mutableString removeAttribute:NSFontAttributeName range:range];
          [mutableString addAttribute:NSFontAttributeName value:newFont range:range];
      }
  }];
  self.attributedText = [mutableString copy];
  </code></pre>
  
  <p>I noticed that while running this code in a <code>while</code> loop checking sizeThatFits to know when the text is small enough to fit that I would have a race to zero occur in some circumstances.  The height is being calculated as 60px for any font value smaller than what I started with, which happens to be 50px.</p>
  
  <p>When <code>NSLog</code>ing the NSAttributedString I find that there are several attributes that I did not add with the key <code>NSOriginalFont</code> which does not appear to be in the list of supported attributes <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/NSAttributedString_UIKit_Additions/Reference/Reference.html">here</a>.  What's going on with NSOriginalFont?  Why is my size being calculated incorrectly?</p>