• 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: Why do all these methods of measuring string metrics with font attribute fail?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why do all these methods of measuring string metrics with font attribute fail?


  • Subject: Re: Why do all these methods of measuring string metrics with font attribute fail?
  • From: "Henry McGilton (Starbase)" <email@hidden>
  • Date: Thu, 4 Sep 2008 21:41:35 -0700


On Sep 3, 2008, at 9:38 AM, Douglas Davidson wrote:

On Sep 3, 2008, at 6:01 AM, an0 wrote:

So, can anyone tell me why all these fell through so badly, and what
is the true straightforward way to do this if any?

The true straightforward way to do this is with -sizeToFit.

-sizeWithAttributes: will give you the size of the string,
but what you appear to want here is to size the textfield, which is not the same thing.


Coming into this discussion a little late . . .

A little experimenting suggests to me that -sizeWithAttributes: appears to
not really give you the *real* size of the string (by which I think you
might mean the measured size of the glyphs indicated by that string). The
size appears to contain an advance or right-side bearing space after
the final character. So the size looks like it's some number of units
bigger than the strict bounding box of the string of glyphs.


I would appreciate some ideas on how to find a *real* bounding box for
a string.

    Cheers,
        . . . . . . . .    Henry


_______________________________________________

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: 
 >Why do all these methods of measuring string metrics with font attribute fail? (From: an0 <email@hidden>)
 >Re: Why do all these methods of measuring string metrics with font attribute fail? (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: string convertion: converting getter name to setter
  • Next by Date: Re: string convertion: converting getter name to setter
  • Previous by thread: Re: Why do all these methods of measuring string metrics with font attribute fail?
  • Next by thread: Re: Why do all these methods of measuring string metrics with font attribute fail?
  • Index(es):
    • Date
    • Thread