Re: boundingRectWithSize gives wrong size
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