Re: Fastest way to predict bounding box for a string
Re: Fastest way to predict bounding box for a string
- Subject: Re: Fastest way to predict bounding box for a string
- From: Douglas Davidson <email@hidden>
- Date: Mon, 6 Feb 2006 16:01:48 -0800
On Feb 6, 2006, at 3:56 PM, Ivan Kourtev wrote:
Any ideas on how to get this size quicker? Is there any way that
has escaped my attention that can return the biggest font size such
that the particular string does not exceed a given bounding
rectangle? Or should I just fall back to binary search of a
certain interval of font sizes? Maybe caching the the size of a
representative character in every size and getting a very good
first guess for the required font size (particularly if the font is
fixed width)? Any ideas or suggestions?
You should be able to do better than binary search with linear
extrapolation.
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