• 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: How to get NSGlyph from unichar?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get NSGlyph from unichar?


  • Subject: Re: How to get NSGlyph from unichar?
  • From: Magnus Strand <email@hidden>
  • Date: Tue, 15 Feb 2005 11:34:16 +0100

Thanks, I will try to do this with NSLayoutManager, because I
need to calculate width of kerned text.

Magnus

Douglas Davidson wrote:

On 2005-02-14 01:43:49 -0800 Magnus Strand <email@hidden> wrote:

||But I don't know how to make a NSGlyph from a unichar, except when it is a-z when
you can use the character directly as name for glyphWithName method?


There is no simple to-one mapping from characters to glyphs. The glyph used depends on the font and potentially also on the context of the character within the text. One character may map to multiple glyphs, or multiple characters may map to a single glyph. In the Cocoa text system, the mapping is managed by NSLayoutManager, which calls upon NSGlyphGenerator to perform a first-pass mapping, which may subsequently be modified during layout by NSTypesetter. You can use NSGlyphGenerator directly, but it may be more convenient to use an NSLayoutManager to manage the process.

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: How to get NSGlyph from unichar?
      • From: Douglas Davidson <email@hidden>
References: 
 >Re: How to get NSGlyph from unichar? (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: Anyone got SSL over NSStreams to work?
  • Next by Date: Implementing the Dock genie effect in windows
  • Previous by thread: Re: How to get NSGlyph from unichar?
  • Next by thread: Re: How to get NSGlyph from unichar?
  • Index(es):
    • Date
    • Thread