Re: boundingRectWithSize gives wrong size
Re: boundingRectWithSize gives wrong size
- Subject: Re: boundingRectWithSize gives wrong size
- From: Jens Alfke via Cocoa-dev <email@hidden>
- Date: Tue, 10 Sep 2019 12:02:09 -0700
> On Sep 10, 2019, at 9:54 AM, Gabriel Zachmann <email@hidden> wrote:
>
> The excess width is sometimes more, sometimes a bit less, I could not find a
> pattern.
> I guess , it has something to do with the actual glyphs in the string.
How much bigger is it? By a fraction of a character width? Or is it more than
that? The right edge of the rectangle is probably not based on the actual glyph
outline, but on the character's advance width. These can be quite different,
especially in italics or if there are swashes.
> In my case, mesg_string is (usually) two lines of text (one string with \n
> somewhere in the middle),
Why not measure the two lines separately, since you said single-line text works
correctly?
—Jens
_______________________________________________
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