AppleColorEmoji Font Flags?

Discussion in 'iOS Programming' started by ArtOfWarfare, Sep 10, 2011.

  1. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #1
    On Mac OS X Lion, I'm able to access various country flags in the AppleColorEmoji font. When I display a string containing the glyphs in a UITextView that has the font property set to AppleColorEmoji, they get replaced with two, separate, boxed in characters.

    For example, the Japanese flag glyph gets replaced with a boxed in J and a boxed in P.

    Does anyone know why this is and/or how I can remedy it? Because my application is intended to be one that users may copy/paste strings from, making the glyph instead be a UIImage would not be an acceptable remedy.

    For now, I'm thinking I just won't have the flags included.
     
  2. ianray macrumors 6502

    Joined:
    Jun 22, 2010
    Location:
    @
    #2
    This looks like a character-encoding problem. Are you testing on an iDevice or on the emulator?

    What unicode code-point does Lion report for the Japanese flag? What unicode code-point is in the NSString? Try using "\uXXXX" instead of pasting a glyph there (to eliminate encoding issues).

    The boxed 'J' and 'P' are unicode code-points U+1F1EF and U+1F1F5. See: http://unicode.org/charts/PDF/U1F100.pdf.

    The Japanese flag glyph is U+E50B on iDevices. See: http://hasseg.org/stuff/ios-emoji/.

    Hope this helps :)
     
  3. ArtOfWarfare thread starter macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    Wow, thanks :)

    I'm surprised Apple decided to map the emoji flags differently in iOS than in Lion, but included them in both.
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Also, be aware that iOS devices are limited in fonts they support. See this page for more info. Therefore, if the font you are using doesn't support your emoji characters, neither will your device.
     
  5. ianray macrumors 6502

    Joined:
    Jun 22, 2010
    Location:
    @
    #5
    I did some more research:

    http://en.wikipedia.org/wiki/Emoji#Emoji_in_the_Unicode_standard

    http://en.wikipedia.org/wiki/Regional_Indicator_Symbol

     
  6. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #6
    I have some wrappers laying around for using Custom Font's, (I love using them)
     

Share This Page