https://kotlinlang.org logo
#compose
Title
# compose
d

dewildte

10/04/2023, 4:24 PM
Does text in Jetpack Compose have support for Kerning?
c

colintheshots

10/04/2023, 4:30 PM
Is this Android? You can set letterSpacing in the TextStyle in AndroidX Compose UI.
d

dewildte

10/04/2023, 4:30 PM
Is letter spacing and kerning the exact same concept?
c

Chris Fillmore

10/04/2023, 4:31 PM
You could adjust the spacing of individual characters using AnnotatedString I suppose.
💯 1
f

francisco

10/04/2023, 6:08 PM
in your typography theme using
TextStyle
you can control letterSpacing (aka kerning, the spacing between the letters, the higher the number the bigger the gap)
Copy code
val caption: TextStyle = TextStyle(
        fontFamily = roboto,
        fontWeight = FontWeight.Medium,
        fontSize = 12.sp,
        lineHeight = 16.sp,
        letterSpacing = 0.5.sp
    )