1

I am creating a custom keyboard using KeyboardView class provided in API. I want to change the typeface of the label of keys. (i.e. using kiran.ttf file, 'K' will then Displayed as 'क')

I have searched a lot, but couldn't succeeded yet.

Thanks in advance.

  • This may help: [How to change android keyboard key font?][1] [1]: http://stackoverflow.com/a/4949412/456582 – Heidar Aug 12 '12 at 17:58

1 Answers1

0

The only real way to do this (and have it output the correct symbol to an EditText when using the keyboard) is to use UTF-8 unicodes. I'm currently developing an engineering keyboard, and I simply found all the symbols I needed, then I output the unicode using getCurrentInputConnection().commitText("\u2220", 1);

In your case, if you were looking for that character you've got in the question, it's unicode is \u0915

Adding that to my keyboard (for demonstration purposes) gives me this:

Devangari Keyboard Example

with the output in the editText near the top of the screen. The key itself is in the top left corner of the keyboard. The specific set of unicode that comes from is called "Devanagari", and the characters can be found here: http://unicode.org/charts/PDF/U0900.pdf.

Hope that helps!

LukeWaggoner
  • 8,869
  • 1
  • 29
  • 28