• 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: boundingRectWithSize gives wrong size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: boundingRectWithSize gives wrong size


  • Subject: Re: boundingRectWithSize gives wrong size
  • From: Richard Charles via Cocoa-dev <email@hidden>
  • Date: Tue, 10 Sep 2019 13:13:43 -0600

> On Sep 10, 2019, at 10:54 AM, Gabriel Zachmann <email@hidden> wrote:
>
>> I have had good results with CTLineGetTypographicBounds().
>
> This seems to be suitable only for single lines of text.
> But , usually, I've got 2 lines of text.
>
> I looked at Core Text a bit further, but I could not find how to determine
> the width/height of a two-line string.

For multiple lines you need to use a framesetter.

CTFramesetterCreateWithAttributedString()

CTFramesetterSuggestFrameSizeWithConstraints()

--Richard Charles

_______________________________________________

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: 
 >Re: boundingRectWithSize gives wrong size (From: Gabriel Zachmann via Cocoa-dev <email@hidden>)

  • Prev by Date: Re: boundingRectWithSize gives wrong size
  • Next by Date: Re: boundingRectWithSize gives wrong size
  • Previous by thread: Re: boundingRectWithSize gives wrong size
  • Next by thread: 10.15 command line tools headers missing
  • Index(es):
    • Date
    • Thread