Giving Framesetter the correct line spacing adjustment
Several posts have noted difficulties with getting an exact height out of CTFramesetterSuggestFrameSizeWithConstraints, and here, (framesetter post) , @Chris DeSalvo gives what looks like the definitive fix: add a paragraph style setting with the correct line spacing adjustment. DeSalvo gets his “leading” by removing UIFont’s ascender and descender from its lineHeight. I wondered how that would compare to CTFontGetLeading . I worked with fonts created like this: CTFontRef fontr = CTFontCreateWithName((CFStringRef)@"Helvetica Neue", 16.0f, NULL); UIFont *font = [UIFont fontWithName:@"Helvetica