How to implement custom Text Styles using Kotlin and Jetpack Compose

Oscar de la Hera Gomez
Three flowers that represent Kotlin, Jetpack Compose and Android Studio side by side. Beneath them sits the text “*.”

A step by step guide on creating and using custom Jetpack Compose TextStyles using Kotlin in Android Studio. Open Source Github Repository Included.

We recommend that you clone our Open Source Kotlin Starter Project, checking out the main branch and carrying out the steps below. The changes can be found on the tutorial/jetpack-compose/custom-textstyle.

git clone git@github.com:delasign/kotlin-android-starter-project.git

Step One: Add Custom Fonts

A screenshot of Android Studio showing the Type.kt file, with the Robot FontFamily as a Kotlin val.

Add a custom Typeface (Font Family) using the guide below.

Step Two: Apply TextStyle

A screenshot of Android Studio showing you how to implement a custom Jetpack Compose TextStyle. Sample code below.

Apply a custom TextStyle using code similar to the one below.

Step Three: Test

A screenshot of an Android device showing the custom Jetpack Compose TextStyle.

Run your app to confirm that the TextStyle was applied.

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details