1

I am developing one application in which comic font are used and that can be fetched from assets folder. Now I would like to make the text bold. So I simply use :

 Typeface face=Typeface.createFromAsset(this.getAssets(), "fonts/comic.TTF"); 
    la = (TextView) findViewById(R.id.la);
    la.setText("Dog");

    la.setTextAppearance(getApplicationContext(),R.style.boldText);
    la.setTypeface(face); 

String.xml

  <?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello World, timerTest!</string>
    <string name="app_name">timerTest</string>

    <style name="boldText">
        <item name="android:textStyle">bold</item>

    </style>
</resources>

So the problem is when I run project comic.ttf get properly but bold style does not appear on text

jzd
  • 23,473
  • 9
  • 54
  • 76
Nikunj Patel
  • 21,853
  • 23
  • 89
  • 133

1 Answers1

1
Typeface face=Typeface.createFromAsset(this.getAssets(), "fonts/comic.TTF"); 

        la = (TextView) findViewById(R.id.la);
        la.setText("Dog");
        la.setTypeface(face,Typeface.BOLD);     
Nikunj Patel
  • 21,853
  • 23
  • 89
  • 133