Text with custom font and bold style

Manoj Fegde picture Manoj Fegde · Mar 14, 2013 · Viewed 13.8k times · Source

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.

Answer

Simon Dorociak picture Simon Dorociak · Mar 14, 2013

You can achieve it with

textview.setTypeface(tfArchitectsDaughter, Typeface.BOLD);

Note: For sure you can use also ITALIC and BOLD_ITALIC