• 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: Getting glyphs for surrogate characters ??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting glyphs for surrogate characters ??


  • Subject: Re: Getting glyphs for surrogate characters ??
  • From: Alastair Houghton <email@hidden>
  • Date: Sun, 27 Sep 2009 18:25:14 +0100

On 27 Sep 2009, at 16:51, Anders Lassen wrote:

I may have solved the problem described above.

The method glyphAtIndex returns two glyphs. The first one is actually the correct glyph for the surrogate character. The next one is zero.

Indeed, the system generates a special NSNullGlyph in many of these cases, the reason presumably being that it keeps the character ranges and glyph ranges aligned.


*However*, I'm not sure that there is any guarantee that a single character won't map in general to multiple glyphs, or indeed that a given character will directly result in *any* glyphs of its own.

You really do need to cope with these cases in your code, because they come up in real use cases. They may be more common in non-Latin languages (Arabic, Indic scripts and Hangul are particularly fun), but even if you only support Latin languages it's possible that some fonts will cause problems for you if you can't cope with an arbitrary number of glyphs per character.

FWIW, if you aren't using the text system for this task, doing it yourself is decidedly non-trivial. I would strongly recommend using the text system, and actually, if you can I would *also* recommend letting the text system do the layout for you, because it is very much more sophisticated than just worrying about bounding boxes and glyph advances.

Kind regards,

Alastair.

--
http://alastairs-place.net




_______________________________________________

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


References: 
 >Getting glyphs for surrogate characters ?? (From: Anders Lassen <email@hidden>)
 >Re: Getting glyphs for surrogate characters ?? (From: Anders Lassen <email@hidden>)

  • Prev by Date: Re: NSMenuItem & NSRuleEditor
  • Next by Date: Re: where to release a CF object thats retained by a cocoa object
  • Previous by thread: Re: Getting glyphs for surrogate characters ??
  • Next by thread: NSMenuItem & NSRuleEditor
  • Index(es):
    • Date
    • Thread