Font of letters for a Textview

0

I need to change the source of a Textview . My question is the following the fonts for the letters are special for android or serves a standard. I suggest some bookstore or source download page, thanks.

For example:

I will place my Textview so that it is not based on opinions: p

<TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imageView2"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="10dp"
        android:text="CARROS A PEDALES"
        android:textColor="#ffffff"
        android:textSize="21dp"
        android:textStyle="bold" />
    
asked by Ashley G. 09.09.2017 в 00:15
source

1 answer

1

One way is to place the ttf files in a folder inside Assets. To create the folder assets : right click on app : New, Folder, Assets Folder, Target Source Set: main, Finish. Once created assets right click on: Show in Explorer , you open the assets folder, you create the fonts folder and there you paste the ttf files

And in java is where you configure the textView:

    TextView textView = (TextView) findViewById(R.id.textView);
    Typeface font = Typeface.createFromAsset(getAssets(), "fonts/MoonLight Regular.ttf");
    textView.setTypeface(font); 
    
answered by 09.09.2017 / 01:56
source