Android Compose Material Typography: Types and Sizes

Default Types and Sizes

Typography(    defaultFontFamily: FontFamily? = FontFamily.Default,    h1: TextStyle? = TextStyle(            fontWeight = FontWeight.Light,            fontSize = 96.sp,            letterSpacing = (-1.5).sp        ),    h2: TextStyle? = TextStyle(            fontWeight = FontWeight.Light,            fontSize = 60.sp,            letterSpacing = (-0.5).sp        ),    h3: TextStyle? = TextStyle(            fontWeight = FontWeight.Normal,            fontSize = 48.sp,            letterSpacing = 0.sp        ),    h4: TextStyle? = TextStyle(            fontWeight = FontWeight.Normal,            fontSize = 34.sp,            letterSpacing = 0.25.sp        ),    h5: TextStyle? = TextStyle(            fontWeight = FontWeight.Normal,            fontSize = 24.sp,            letterSpacing = 0.sp        ),    h6: TextStyle? = TextStyle(            fontWeight = FontWeight.Medium,            fontSize = 20.sp,            letterSpacing = 0.15.sp        ),    subtitle1: TextStyle? = TextStyle(            fontWeight = FontWeight.Normal,            fontSize = 16.sp,            letterSpacing = 0.15.sp        ),    subtitle2: TextStyle? = TextStyle(            fontWeight = FontWeight.Medium,            fontSize = 14.sp,            letterSpacing = 0.1.sp        ),    body1: TextStyle? = TextStyle(            fontWeight = FontWeight.Normal,            fontSize = 16.sp,            letterSpacing = 0.5.sp        ),    body2: TextStyle? = TextStyle(            fontWeight = FontWeight.Normal,            fontSize = 14.sp,            letterSpacing = 0.25.sp        ),    button: TextStyle? = TextStyle(            fontWeight = FontWeight.Medium,            fontSize = 14.sp,            letterSpacing = 1.25.sp        ),    caption: TextStyle? = TextStyle(            fontWeight = FontWeight.Normal,            fontSize = 12.sp,            letterSpacing = 0.4.sp        ),    overline: TextStyle? = TextStyle(            fontWeight = FontWeight.Normal,            fontSize = 10.sp,            letterSpacing = 1.5.sp        ))

Modify Typography Sizes

Edit ui.theme.Type.kt

val Typography = Typography(    body1 = TextStyle(        fontFamily = FontFamily.Default,        fontWeight = FontWeight.Normal,        fontSize = 16.sp    ),    subtitle1 = TextStyle(        fontWeight = FontWeight.SemiBold,        fontSize = 16.sp,        letterSpacing = 0.15.sp    ),)

References:

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.