Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
- Subject: Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
- From: Koen van der Drift <email@hidden>
- Date: Fri, 17 May 2013 18:03:30 -0400
Thanks all for the insightful responses. In my case I am using a monospaced
font, and everything looks pretty square. The thing I did wrong as it
turned out was that I had a little padding on the top, making my CTView to
slightly shift down, and therefore making the final string disappear.
My code looks like this now:
CGSize frameSize = CTFramesetterSuggestFrameSizeWithConstraints(framesetter,
CFRangeMake(0, 0),
NULL,
CGSizeMake(self.bounds.size.width,
CGFLOAT_MAX), &fitRange);
self.frame = CGRectMake(self.frame.origin.x,
self.frame.origin.y,
self.frame.size.width,
frameSize.height + PADDING_TOP); <<===
correction for padding
Cheers,
- Koen.
On Fri, May 17, 2013 at 5:42 PM, Quincey Morris <
email@hidden> wrote:
> On May 17, 2013, at 11:20 , Robert Vojta <email@hidden> wrote:
>
> Height was wrong even if returned width <= constrained width.
>
>
> Once I took proper account of the returned width, I got no more "wrong"
> heights.
>
> However, IIRC, there was a separate issue that fractional line heights
> didn't work correctly. Maybe you ran into that problem as well.
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden