Re: Scaling Fonts;
Re: Scaling Fonts;
- Subject: Re: Scaling Fonts;
- From: Douglas Davidson <email@hidden>
- Date: Fri, 1 Apr 2005 09:54:59 -0800
On Apr 1, 2005, at 9:43 AM, Matt Budd (Madentec) wrote:
Hello,
Is there a way to determine the largest font size for a given font
that will fit in a rect?
I know that NSAttributedString has a - (NSSize)size method, and I
could iteratively increase the font size until I hit one that was
too large and then use the last size, but is there a better/quicker
way?
This is basically a root-finding algorithm. The function in question
should be pretty close to linear, however, so you should be able to
find it pretty quickly.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Scaling Fonts; (From: Matt Budd (Madentec) <email@hidden>) |