• 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: Fastest way to predict bounding box for a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fastest way to predict bounding box for a string


  • Subject: Re: Fastest way to predict bounding box for a string
  • From: Ivan Kourtev <email@hidden>
  • Date: Mon, 6 Feb 2006 19:48:35 -0500

Does your suggestion mean that if I take the bounding boxes of a certain string in sizes 5, 10, and 20, of the same font, then the widths and heights of these bounding boxes will be related to each other roughly as 5:10:20 with any small inconsistencies arising from the changing thickness of the drawing pen?

I thought of this approach briefly but dismissed it because I think that's not how it works in the real typesetting world (my knowledge of which is admittedly also limited).

--
ivan

On Feb 6, 2006, at 7:01 PM, Douglas Davidson wrote:


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
  • Follow-Ups:
    • Re: Fastest way to predict bounding box for a string
      • From: Keith Wilson <email@hidden>
    • Re: Fastest way to predict bounding box for a string
      • From: Douglas Davidson <email@hidden>
References: 
 >Fastest way to predict bounding box for a string (From: Ivan Kourtev <email@hidden>)
 >Re: Fastest way to predict bounding box for a string (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: subclassing a window
  • Next by Date: Re: Authoring application Help
  • Previous by thread: Re: Fastest way to predict bounding box for a string
  • Next by thread: Re: Fastest way to predict bounding box for a string
  • Index(es):
    • Date
    • Thread