-1

So I'd like to change the fontFamily in Android but i want to use different font family for header and sub text.How can i achieve it..?

Aswin N
  • 11
  • 5
  • 1
    Possible duplicate of [How to change fontFamily of TextView in Android](https://stackoverflow.com/questions/12128331/how-to-change-fontfamily-of-textview-in-android) – Bö macht Blau Aug 24 '17 at 17:57

2 Answers2

0
 <TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Enter the password :"
    android:textColor="#000000"
    android:fontFamily="sans-serif"
    android:layout_marginTop="75dp"/>
Jeffy
  • 276
  • 3
  • 9
0

If you want to use different font which is not availabe in font-family then you can download that font from internet and then

Put your font in assets folder, then create new Typeface from it

Here is an example

TextView txt = (TextView) findViewById(R.id.custom_font); Typeface font = Typeface.createFromAsset(getAssets(), "SomeFont.ttf"); txt.setTypeface(font);

Nilesh
  • 1
  • 1