954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Custom Font inside Android Application

I designed an application UI for an android application and used Arial font inside the app for all the text. Now the developer used the default fonts of Android. I asked him to overwrite the default fonts with Arial. He placed the Arial.ttf file inside the font directory and the problem was solved. BUT now, I downloaded new font app on my android handset which is used to change the default font of android from the settings menu. When I change that font, the Arial font in my specific application changes too. I am looking for a solution though which I can use my custom defined font in my developer application and even if Android Font settings are changed, my app is not effected with it.

tAALz
Newbie Poster
10 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

you will need to put the font file in your Android App's "assets" folder and then set it to each text view you have...using:

TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "MyFont.ttf");
txt.setTypeface(font);
highondota
Newbie Poster
2 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: