How to get a simple Unicode globe symbol

If you specify Unicode characters in NSString , many of them will take a set of colors for this text - they are just regular glyphs for this font, so they appear like any other character. But there are some Unicode characters that are colored, like GLOBE WITH MERIDIANS , which is a blue gradient with shadows. But I saw the same glyph elsewhere that a simple black outline without a shadow, for example, on an iOS keyboard. I would like to use this symbol, but without decorations and without the need to create and use an image. I wondered if another font would display it in a different format, and iOSFonts.com shows different styles (bolder, italics) re all blue. Is it possible to get a simple version?

Of course, this is possible because it is similar to what Apple implemented with Tip. Note that the globe is the same color as the text, and it is included in the string along with all other characters. Surely not UIImage ?

screenshot

Character in different fonts:
enter image description here

EDIT: The solution asked in the related question does not work for this symbol, since the variant symbol looks exactly the same as the original - blue with shadows.

+6
source share
1 answer

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

If you really need a font that displays this symbol as a simple black outline, you can pack a copy of Symbola (downloaded here ) into your application.

Alternatively, you can make a bitmap with the desired icon and use NSTextAttachment to put it in the attribute string. Apple is probably doing something in this direction, as many of their tips include characters that are definitely not Unicode characters:

β€œText is smarter with iMessage applications: access something interesting without leaving messages. Save icon], then swipe to select an application. Get iMessage applications from the App Store.

+2
source

Source: https://habr.com/ru/post/971635/


All Articles