I want to show text in Arial font. But Arial font is not available in android system fonts. I don't want to use arial ttf file in my application. Is there any other way to apply text with Arial font.
If the font is not available in the android system, then you have to use the font file to apply that particular font say arial to your textView
. May I know why you are not willing to use the font file to apply as it gives the same functionality.
Sample usage for using the font file is:
Typeface tfArial = Typeface.createFromAsset(getAssets(), "arial.ttf");
TextView tv = null;
// find the textview id from layout or create dynamically
tv.setTypeface(tfArial);
EDIT:
You need to put the font file arial.ttf
in your asset
folder.
Download Arial font and in assets create folder name with "fonts" and save font at there
Typeface tf = Typeface.createFromAsset(getAssets(),"fonts/arial.ttf");
TextView tv = (TextView) findViewById(R.id.CustomFontText);
tv.setTypeface(tf);
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