• 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: Why do all these methods of measuring string metrics with font attribute fail?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Graham Cox <email@hidden>
  • Date: Fri, 5 Sep 2008 00:05:57 +1000


On 4 Sep 2008, at 11:27 pm, an0 wrote:

If they give no useful information for
application programmers,


Yes they do, but perhaps just not for your application. If you want to use glyphs as a graphic element for example, it's sometimes useful to query these sizes without having to try laying them out as text. Remember, there is a big difference, conceptually, between a string (a collection of characters) and a font (a collection of glyphs). Glyphs are graphical entities, and most of the stuff in NSFont and NSFontManager is there to support these concepts at that level.

Your problem (and confusion) appears to stem from the fact that you seem to think that a font is something like a string, and so can be treated as a collection of characters. The layout of glyphs to form an image of a string of text on the screen is a complex process, and applications that do this need to know all sorts of metrics beyond "how much space does this string occupy". In fact to calculate that they need to add up the space occupied by each glyph, and some of the methods you mentioned are there to support that sort of processing.

cheers, Graham
_______________________________________________

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


  • Follow-Ups:
    • Re: Why do all these methods of measuring string metrics with font attribute fail?
      • From: an0 <email@hidden>
References: 
 >Why do all these methods of measuring string metrics with font attribute fail? (From: an0 <email@hidden>)
 >Re: Why do all these methods of measuring string metrics with font attribute fail? (From: Peter Ammon <email@hidden>)
 >Re: Why do all these methods of measuring string metrics with font attribute fail? (From: an0 <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: Re: NSProgressIndicator drawing
  • Previous by thread: Re: Why do all these methods of measuring string metrics with font attribute fail?
  • Next by thread: Re: Why do all these methods of measuring string metrics with font attribute fail?
  • Index(es):
    • Date
    • Thread