This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
malayalam font in android?
I want to display Malayalam text in my app, is it possible? I have tried using typeface from gont file of malayalam language. But it doesn't work. Is there any other way to do it. Please give me some
suggestions,
Thanks in advance.
Get your required Malayalam font into your assets folder of your application. And, follow the below steps -
Just use this font to your TextView with Typeface like below code
Typeface typeFace = Typeface.createFromAsset(getAssets(),"malyalam.fnt");
and then add it to your textview like below
textView.setTypeFace(typeFace);
Get your malayalam fonts here -
Malayalam Fonts and Fonts for Malayalam
Hope this helps you.
Update
I just tested below code with one malayalam font. Its working fine. Try with that -
TextView t = (TextView)findViewById(R.id.textView1);
t.setText("മലയാളം");
Typeface typeFace = Typeface.createFromAsset(getAssets(),"AnjaliOldLipi.ttf");
t.setTypeface(typeFace);
Related
I have been trying to show marathi font using this link in my app. But some how its not working for me. It gives no error but does not show any font in text view. I came to know about internationalization concept when I first tried to do this.
TextView info=(TextView)findViewById(R.id.textview);
Typeface face= Typeface.createFromAsset(this.getAssets(), "fonts/FontAwesome.otf");
info.setTypeface(face);
info.setText("TypeFace");
I have created an android app, in that I want to set Gujarati joint word.
I use Shruti.ttf font.
I want to print -
નર્સિંગ
But it prints-
નર્ સંગિ
So, how to print proper.
My code is -
TextView tv_guj=(TextView)findViewById(R.id.tv_gujarati);
Typeface font = Typeface.createFromAsset(getAssets(), "Shruti.ttf");
tv_guj.setTypeface(font);
tv_guj.setText("નર્સિંગ");
Please try this sample and copy your text to this sample text view it will work and will show proper result as you want
https://www.dropbox.com/s/6pqg9otcli038ij/HindiFont.zip
Lohit-Gujarati font is working
you can use terafont of gujarati Fontface so it will be implemented.
Thanks
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Set Locale programatically
I am a beginner in android. making my first app, all i want to do is localize my app to urdu language/pakistan. what should i do.
Where I can get the list of all android locale?
This post may be helpful, code of Urdu - Pakistan is ur-PK, which may not be present for your use. List of all android locale can be found here or here. Also take a look at localization tutorial
If you want to use urdu font for showing text in a view(say TextView) then:
Code for setting custom font to TextView:
Assuming you have a urdu ttf font say(URDU.ttf) font in fonts folder under assets folder:
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/URDU.ttf");
TextView tv = (TextView) findViewById(R.id.txtview);
tv.setTypeface(tf);
You might want to look this question. Also for urdu-pakistan you might get the code from here
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Android - Using Custom Font
i am creating an application in arabic
and have a custom font that i want to use
can someone tell me the code i should use in my java class
i tried this
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "trado.ttf");
txt.setTypeface(font);
but the ending line that says font theres an error that says
Syntax error on token "font", VariableDeclaratorId expected after this token
Can someone help!
try this, as in adding this lol
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(this.getAssets(), "trado.ttf");
txt.setTypeface(font);
Save your custom font file in a folder fonts inside the assets folder.
for example:
assets/fonts/trado.ttf
and make sure your font extension (i.e ttf in your case) is in lower case.
I have an app that must show some Malayalam text. I used some Malayalam fonts and tried to use that through typeface. Though all the characters are shown, some of the symbols are not shown or are displaced. I use android 2.2. Can anyone guide me to solve this problem?
As Malayalam fonts are not supported by Android, you can still give that support to your Application.
For Marathi font copy font file to your asset folder. then use the following code.
TextView text_view = new TextView(this);
Typeface font = Typeface.createFromAsset(getAssets(), "MalayalamFont.ttf");
text_view.setTypeface(font);
text_view.setText("മലയാളം");
the same way u can give support for hindi....
We can add font files to the assets folder and from there we can load it. here is useful link for you..
Display malayalam text in my app