> On Apr 6, 2015, at 2:09 PM, Jack Brindle <jackbrin...@me.com> wrote:
> 
> Have you checked the Font you are using to display the character string to 
> see if it contains the bicycle character? If not, you probably won’t get the 
> character you seek.

Fonts have nothing to do with it; they’re an aspect of rendering text, not of 
working with the text in memory. (If it weren’t this way, you wouldn’t be able 
to work with NSString at all; everything would have to be based on 
NSAttributedString to carry around the font info for every character.)

The bicycle is a well-defined Unicode character, an emoji. When it comes time 
to render it, the typesetter will look for a glyph in the current font for that 
character code. It probably won’t find one, so it will go through a series of 
fallback fonts looking for a glyph until it finds one in whatever internal font 
stores the emoji glyphs. Then it uses that font to render it.

This is the same process that allows you to put Japanese or Cyrillic characters 
in a string and render them in Helvetica or Papyrus even though those fonts 
don’t support those character sets. They’re actually being rendered in whatever 
system font is the default for those character sets. This is all invisible to 
you unless you start diving down into the NSTypesetter or CoreText APIs.

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to