Several posts have noted difficulties with getting an exact height out of CTFramesetterSuggestFrameSizeWithConstraints, and here, (framesetter post), @Chris DeSalvo gives wh
Answers to the 3 questions I had above:
CTFontGetLeading(fontRef)
to get the font's normal leading, or plug in whatever value (as a CGFloat) you choose.Answers 1 and 2 work: Specifying a leading value in a paragraphStyle attribute of your attributed string will enable the Core-Text framesetter to calculate its height exactly.
There are two caveats:
And there is one mystery: What is going on with UIFont's deprecated leading? Leading and lineHeight are two distinct things.