• 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: Scaling Fonts;
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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>)

  • Prev by Date: Re: NSToolbar Problem
  • Next by Date: Re: NSToolbar Problem
  • Previous by thread: Scaling Fonts;
  • Next by thread: multiple keys for object?
  • Index(es):
    • Date
    • Thread