3

I would like to show the character ⁵ in a TextView for Android. Not 5, but ⁵. I succeed in showing ¹²³ and ⁴, but ⁵ to ⁹ (and ⁰) don't work (it is replaced by a blank space)

For several reasons, I don't want to use html tags, so I write the characters in the xml the way I want them to appear, not with <sup></sup>.

Do you have any idea why it doesn't work for ⁵⁶⁷⁸⁹⁰ ? Do you know how to solve the problem ?

Thank for your help.

Patrick
  • 3,578
  • 5
  • 31
  • 53
user2346922
  • 167
  • 1
  • 10

2 Answers2

0

5 - exists, but it is not visible. It just takes up space.
May be it is a bug with the font.
Try to use another. How to set custom font

Or try to use unicode directly
For ex. \u2075

Hope it's help

jimpanzer
  • 3,470
  • 4
  • 44
  • 84
  • OK. So I just tried \u2075, and it's all the same. Except that this time, I tried on another device, and both ⁵ and \u2075 are replace by and empty square. I'm going to try another font. – user2346922 May 03 '13 at 13:10
  • Yes, I think it just font bug, but please, add comment will decide whether to change the font problem. – jimpanzer May 03 '13 at 13:12
  • what do you mean 'the unicode directly' ? these characters don't exist in iso, the android xml files are utf-8, and the characters or they unicode value are identical, aren't they ? – njzk2 May 03 '13 at 13:14
  • si I just tried serif, freemono, monospace, sans and normal (that's all what eclipse accepts) with android:typeface="normal", and it doesn't solve the problem. – user2346922 May 03 '13 at 13:21
  • @jimpanzer : What do you mean by "add comment will decide whether to change the font problem" ? – user2346922 May 03 '13 at 13:22
  • @njzk2, just try to do this, android:text="@string/string_with_unicode", where \u00A9 StackOverflow and you understand what I mean. – jimpanzer May 03 '13 at 13:23
  • A9 is ©, i still don't see the difference between one and the other? – njzk2 May 03 '13 at 13:50
0

Your font apparently doesn't support this section of Unicode (U+2070 to U+209F)

You can include your own font in your app and use it for these textViews. (see Android - Using Custom Font)

Community
  • 1
  • 1
njzk2
  • 38,969
  • 7
  • 69
  • 107