• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >CTFramesetterSuggestFrameSizeWithConstraints cuts off text (From: Koen van der Drift <email@hidden>)
 >Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text (From: Quincey Morris <email@hidden>)
 >Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text (From: Robert Vojta <email@hidden>)
 >Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
  • Next by Date: Re: [SOLVED] SecTrustEvaluate() failing with kSecTrustResultRecoverableTrustFailure
  • Previous by thread: Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
  • Next by thread: Re: CTFramesetterSuggestFrameSizeWithConstraints cuts off text
  • Index(es):
    • Date
    • Thread