Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
- Subject: Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
- From: Graham Cox <email@hidden>
- Date: Sat, 18 May 2013 09:10:34 +1000
On 17/05/2013, at 11:38 PM, Koen van der Drift <email@hidden> wrote:
> // calculate the size it occupies
>
> CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(attrString);
> []
> // draw the string:
>
> []
> CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef) attrString);
Don't create the framesetter object twice. I'm not sure it has a bearing on your issue, but it would make sense that the framesetter used to calculate the frame should be the exact same one that draws the frame. It might be that creating it and calculating the size performs some caching that speeds up the second use. In any case it will use less memory if you only use one.
--Graham
_______________________________________________
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