NSMutableAttributedString does strange things with 𝛑 and 𝒆. This is Unicode "Mathematical Bold Small Pi" and the 𝒆 that is near it in the Unicode table. Less exotic characters don't have this problem.
-
Changing the attribute map of an existing NSMutableAttributedString containing these characters with some foreground colors (like white, for instance) results in a strange doubling of the character when the resulting string is rendered in a CATextLayer. It doesn't happen if the NSMutableAttributedString is created with the different map. It only happens when you use #setAttributes on an existing string.
-
Displaying an NSMutableAttributedString containing these characters with various colors applied in a UITextField results in the strange doubling regardless of the colors involved. Furthermore, attribute ranges are thrown off by this.
NSMutableAttributedString does strange things with 𝛑 and 𝒆.
Can you post some code snippets showing how youโre doing these mutations?
One thing to note here is that both 𝛑 and 𝒆 are outside of the Basic Multilingual Plane [1], which is tricky when using NSString
and friends because they use UTF-16 and hence you have to deal with surrogate pairs. Itโs possible that your code is not doing that correctly. Then again, itโs also possible that NSMutableAttributedString
is not doing that correctly (-:
Share and Enjoy
โ
Quinn โThe Eskimo!โ @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Being:
-
U+1D486 MATHEMATICAL BOLD ITALIC SMALL E
-
U+1D6D1 MATHEMATICAL BOLD SMALL PI