0

I want to view all codes and symbols in custom font which I have loaded in assets of Android JDK. How do I do this? Thank you for helping.

user725803
  • 227
  • 2
  • 5
  • 12

1 Answers1

1

You should create a TextView, add the characters that you want, then set the font of the TextView.

See here and here for changing fonts in a TextView.

Something like this should work to print out the characters:

StringBuilder sb = new StringBuilder();

// Loop over readable ASCII characters 32 to 127 as per http://www.asciitable.com/
for (int i = 32; i < 127; i++) {
    sb.append((char) i);
}

TextView tv = (TextView) findViewByID(yourID);

tv.setText(sb.toString());
Community
  • 1
  • 1
Martin Foot
  • 3,594
  • 3
  • 28
  • 35
  • Thank's, but I don't know set of codes symbols this custom font. How can I see them? – user725803 Jul 31 '11 at 08:58
  • I'm not entirely sure what you mean, but you can change the range from 32--126 to whatever you want, and print out both the number and the character that it represents if you wish. Be warned, if the font contains newlines and delete characters this might look a bit strange. It would be best to use a font viewer rather than test the font on your device. – Martin Foot Jul 31 '11 at 09:01