Text spacing - Jetpack Compose
In Jetpack Compose, you can use the following properties to change text spacing:
letterSpacing
: set spacing between letterslineHeight
: set spacing between linesbaselineShift
: change how much text is shifted up from current baselineLineHeightStyle.Alignment
: defines how text is aligned in the space provided by the line heightpadding
: set spacing between paragraphs
Text(
text = "Appt",
style = TextStyle(
letterSpacing = 3.sp,
lineHeight = 20.sp,
baselineShift = BaselineShift(1.5F),
lineHeightStyle = LineHeightStyle(
alignment = LineHeightStyle.Alignment.Proportional,
)
),
modifier = Modifier
.padding(bottom = 20.dp)
)