How does CTFramesetterSuggestFrameSizeWithConstraints work?

The CGSize it returns is not the same one I get if I manually combine the rectangles for each line in the frame. I can get the same *width* (depending on which options I use with CTLineGetBounds), but never the same height. Does anyone know how it's calculating the height?


Rob

Replies

Vertical placement of lines is reflected in their origins, not their bounds. Leading is allowed to hang, plus there may be extra space added above the first line may be moved down depending on the font to allow for diacritics.