• 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: 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

  • Follow-Ups:
    • Re: boundingRectWithSize gives wrong size
      • From: Gabriel Zachmann via Cocoa-dev <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: Re: boundingRectWithSize gives wrong size
  • Index(es):
    • Date
    • Thread