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.
Use the code for making text bold as :
Use a SpannableString. Also have a look at this tutorial.http://blog.stylingandroid.com/archives/177.
You can also use different color for text's in textview.
http://www.chrisumbel.com/article/android_textview_rich_text_spannablestring. The link gives you more example of styling using spannable string.
You can use the below code to set your text as bold
create a seperate file as style.xml
And in your java file if you want the text to be bold after can action means
You can make your text bold as :
You can achieve it with
Note: For sure you can use also
ITALIC
andBOLD_ITALIC