What is the code to display a five digit Unicode based Egyptian hieroglyph font on iOS?
Asked Answered
P

2

7

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")?

Peripteral answered 26/4, 2012 at 8:50 Comment(2)
U+F3001 is private use, so it will only display what you want if you use exactly the right font (but you probably knew that). You could try using ` \uDB8C\uDC01` (which is UTF-16 for U+F3001) and see if that works.Edlin
Actually the four-hex-digit Unicode escape variant doesn't work for most Unicode code points. You have 17 planes and can address only one of them with this method.Chateau
I
8

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

Indisputable answered 27/4, 2012 at 2:14 Comment(0)
A
0

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.

Afterwards answered 26/4, 2012 at 9:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.