Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text with custom font and bold style

I am developing an application. I am using custom font. ".ttf" file to customize font of text view. I used the code as:

Typeface tfArchitectsDaughter = Typeface.createFromAsset(getAssets(), "fonts/ArchitectsDaughter.ttf");
textview.setTypeface(tfArchitectsDaughter);

Now the need is: I want to make the text customize as I done above as well as the style as BOLD in .java file.

How to do this please suggest. And what other styles or customization can be done on font please suggest.

like image 746
Manoj Fegde Avatar asked Nov 28 '22 05:11

Manoj Fegde


1 Answers

You can achieve it with

textview.setTypeface(tfArchitectsDaughter, Typeface.BOLD);

Note: For sure you can use also ITALIC and BOLD_ITALIC

like image 69
Simon Dorociak Avatar answered Jan 13 '23 08:01

Simon Dorociak