Re: Why do all these methods of measuring string metrics with font attribute fail?
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: an0 <email@hidden>
- Date: Thu, 4 Sep 2008 09:57:12 +0800
IMO, the size of a string with font attribute is an intrinsic property
determined only by the string and the font(and the layout of the
string on the view, but here let's fix the layout to one single line);
and the view used to render the attributed string should have a
reasonalby bigger size to hold the whole string. In other words, one
could have a good guess of the view size from the attributed string
size.
So, if my understanding of these two metrics is right, how can they
differ so much? Was I using the wrong APIs?
If my understanding is wrong, can you tell me what's the exact
relationship between these two metrics?
On Thu, Sep 4, 2008 at 12:38 AM, Douglas Davidson <email@hidden> 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.
>
> Douglas Davidson
>
>
_______________________________________________
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