Code on StackOverflow and other sites suggest this for displaying unicode on iOS:

[view1 setText:@"\uF300"];

This works for most unicode characters, however, this is failing for an Egyptian hieroglyphic unicode font (wait for large font to load).

The hieroglyphic unicode has one additional digit (i.e. "\uF3001" instead of "\uF300"). As a result, the wrong character is displayed and the "1" is left trailing.

It is clear that iOS can display the hieroglyphic font. For example, if you cut and paste this glyph (󳑡) into a setText statement, after importing the TTF, the glyph can be seen on the iOS screen.

So the question is, how does one display a unicode character in a setText statement using a unicode font that needs five digits instead of four (i.e. "\uF3001")?

有帮助吗?

解决方案

Actually, as long as you use a capital 'U' you can specify up to 8 digits like: "\U000F3001".

其他提示

It is not possible through the method you are using:

https://developer.apple.com/library/ios/#documentation/MacOSX/Conceptual/BPInternational/Articles/NotesForLocalizers.html

Strings can include arbitrary Unicode characters with “\U” followed by up to four hexadecimal digits denoting the Unicode character; for instance, space, which is hexadecimal 20, is represented as “\U0020”. This option is useful if strings must include Unicode characters which cannot be typed for some reason.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top