Get new font in android studio.

Himanshu Choudhary
2 min readAug 11, 2018

--

To get new font in android studio, you first need to build an android studio project. When the project building is finished, get a text view or edit text or any other thing on which you want to apply the new font in the XML file of your activity.

I have used a text-view in this example. You can use any other item, if you want.

start_sreen

Code of text view:

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textSize="30sp"
android:textColor="@color/colorPrimary"
android:text="Hello World !!"
android:padding="10dp"
/>

Now, go to design view of XML :

screen_two

Now, find font family in these options:

screen_three

Now, click on font family option and select more fonts. A new window will open on the click:

screen_four

Search for the font which you want to add and choose the style of that font. I have choose “nunito” font and font style is regular.

screen_five

Then select ok. And that font will be added to that view.

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:fontFamily="@font/nunito"
android:padding="10dp"
android:text="Hello World !!"
android:textColor="@color/colorPrimary"
android:textSize="30sp"
/>

The final result will be like this:

screen_six

Few more example: font- Yatra One

screen_seven

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response