CoreText. How Do I Calculate the Bounding Box of an Attributed String?
In CoreText it is easy ask: "for a given rectangle how much of this attributed string will fit?". CTFrameGetVisibleStringRange(rect).length Will return where in the string the next run of text should begin. My question is: "given an attributed string and a width, what rect height do I need to completely bound the attributed string?". Does the CoreText framework provide tools to do this? Thanks, Doug Joshua What you need is CTFramesetterSuggestFrameSizeWithConstraints() , you can use it like so: CTFramesetterRef frameSetter = CTFramesetterCreateWithAttributedString((__bridge