According to the documentation, kCTParagraphStyleSpecifierMaximumLineHeight was supposed to solve this problem, but, unfortunately, does not work, at least on iOS 4.3.
CTParagraphStyleSetting theSettings[5] = { { kCTParagraphStyleSpecifierParagraphSpacing, sizeof(CGFloat), &spaceBetweenParaghraphs }, { kCTParagraphStyleSpecifierParagraphSpacingBefore, sizeof(CGFloat), &topSpacing }, { kCTParagraphStyleSpecifierLineSpacing, sizeof(CGFloat), &spaceBetweenLines }, { kCTParagraphStyleSpecifierMinimumLineHeight, sizeof(CGFloat), &lineHeight}, { kCTParagraphStyleSpecifierMaximumLineHeight, sizeof(CGFloat), &lineHeight} }; CTParagraphStyleRef paragraphStyle = CTParagraphStyleCreate(theSettings, 5);
To be fair, this suggests that it is available in OS v10.5 and later.
kCTParagraphStyleSpecifierMaximumLineHeight :
The maximum height that any line in the frame occupies, regardless of the size or font size of any attached graphics. Glyphs and graphics that exceed this height will overlap adjacent lines. Maximum height 0 means no line height limit. This value is always non-negative.
Type: CGFloat.
Default: 0.0.
Application: CTFramesetter.
Available on Mac OS X version 10.5 and later. Declared in CTParagraphStyle.h.
marco source share