title: Core Text's CTFramesetterSuggestFrameSizeWithConstraints() returns incorrect size every time
body: <p>According to the docs, <code>CTFramesetterSuggestFrameSizeWithConstraints ()</code> &quot;determines the frame size needed for a string range&quot;.</p>
  <p>Unfortunately the size returned by this function is never accurate.  Here is what I am doing:</p>
  <pre><code>    NSAttributedString *string = [[[NSAttributedString alloc] initWithString:@&quot;lorem ipsum&quot; attributes:nil] autorelease];
      CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef) string);
      CGSize textSize = CTFramesetterSuggestFrameSizeWithConstraints(framesetter, CFRangeMake(0,0), NULL, CGSizeMake(rect.size.width, CGFLOAT_MAX), NULL);
  </code></pre>
  <p>The returned size always has the correct width calculated, however the height is always slightly shorter than what is expected.</p>
  <p>Is this the correct way to use this method?</p>
  <p>Is there any other way to layout Core Text?</p>
  <p>Seems I am not the only one to run into problems with this method.  See <a href="https://devforums.apple.com/message/181450" rel="noreferrer">https://devforums.apple.com/message/181450</a>.</p>
  <p>Edit:
  I measured the same string with Quartz using <code>sizeWithFont:</code>, supplying the same font to both the attributed string, and to Quartz.  Here are the measurements I received:</p>
  <blockquote>
  <p>Core Text: 133.569336 x 16.592285</p>
  <p>Quartz: 135.000000 x 31.000000</p>
  </blockquote>