Core Text's CTFramesetterSuggestFrameSizeWithConstraints() returns incorrect size every time
- 阅读更多 关于 Core Text's CTFramesetterSuggestFrameSizeWithConstraints() returns incorrect size every time
问题 According to the docs, CTFramesetterSuggestFrameSizeWithConstraints () "determines the frame size needed for a string range". Unfortunately the size returned by this function is never accurate. Here is what I am doing: NSAttributedString *string = [[[NSAttributedString alloc] initWithString:@"lorem ipsum" attributes:nil] autorelease]; CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef) string); CGSize textSize =