Member-only story
Add Custom Fonts in Android Java
A custom font for Android refers to using a typeface other than the default system fonts provided by the Android operating system. Android allows developers to incorporate custom fonts into their applications, offering greater flexibility in design and branding.
- This is the link to download custom font https://fonts.google.com/selection — the format in ttf
- Create font folder in android studio to put custom font ttf format
3. Put downloaded ttf file into font folder
4. Use custom font in activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity"
android:gravity="center_vertical">
<TextView
android:layout_margin="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Testing font"
android:fontFamily="@font/courgette_regular"
android:textSize="30dp"/>
</LinearLayout>5. Result
THE END







