I want to type in different languages in android other than English like Hebrew by providing ttf files. Are there any in build API's so I can use that?
There is an example on how to use custom typefaces in the API Demos. That said, you may not need to. This article seems to indicate that the default font (Droid) probably contains all the necessary characters for (at least) the target markets for Android.
Other than that, the developer site has pretty good documentation on how to "internationalize" an application.
You can localize you application by using ttf files
Here is the sample code to start with
Create a folder under assets with name "fonts". Copy your language file (ex: mylang.ttf).
Load this file using the following code:
Typeface myfont;
myfont=Typeface.createFromAsset(getAssets(),"fonts/mylang.ttf");
TextView textview = (TextView)findViewById(R.id.TextView01);
textview.setText(R.string.my_textview);
textview.setTypeface(myfont);
In string.xml, give "some language string" for my_textview.
Now you can see your language text in android device/emulator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With