Arial font for text in Android

后端 未结 6 1502
悲哀的现实
悲哀的现实 2021-02-20 04:11

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 appl

6条回答
  •  情书的邮戳
    2021-02-20 04:52

    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);
    

提交回复
热议问题