10

If you include Unicode characters in an NSString, a lot of them will take on the color set for that text - they're just regular glyphs for that font so they're displayed like any other character. But there are some Unicode characters that are colored, for example GLOBE WITH MERIDIANS which is a blue gradient with shadows. But I have seen this same glyph elsewhere that's a simple black outline without a shadow, for example in the iOS keyboard. I would like to use that glyph, but without the adornments, and without having to create and use an image. I wondered if a different font would render it in a different format, and while iOSFonts.com does show different styles (bolder, italics), they're all blue. Is it possible to get the simple plain version?

Surely it is possible, because that appears to be exactly what Apple has implemented with a Tip. Notice the globe is the exact same color as the text and it's included in the string along with all the other characters. Surely that's not a UIImage?

screenshot

Character in different fonts:
enter image description here

EDIT: The solution provided in the linked question doesn't work for this character, as the variant character appears to be the exact same as the original - blue with shadows.

1
  • I don't flat out believe this character appears the same in "different fonts". Most likely, it gets drawn with a fallback font (perhaps artificially bolded, for the 2nd and 4th example). Make sure to experiment with a font that actually contains this character.
    – Jongware
    Jul 13, 2014 at 20:09

1 Answer 1

3

Unfortunately, iOS doesn't have a monochrome globe symbol you can use; the only built-in font that includes U+1F310 GLOBE WITH MERIDIANS is Apple Color Emoji.

If you really want a font that renders this character as a simple black outline, you could package a copy of Symbola (downloadable here) into your app.

Alternatively, you could make a bitmap image with the icon you want and use NSTextAttachment to put it into an attributed string. Apple is likely doing something along these lines, as many of their Tips include symbols that are definitely not Unicode characters:

"Text smarter with iMessage apps: Access something fun, without leaving Messages. Tap [App Store icon], then swipe to choose an app. Get iMessage apps from the App Store.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.