TLDR: does android/compose/material have "auto" line height?
When overriding a font style to set a font size, what happens if we don't set line height? Is it automatically adjusted? Or does it keep the default value? Does the answer differ for either of the following:
• Using
.copy
// don't make any change in Type.kt
...
Text(
text = ...
style = MaterialTheme.typography.displayLarge.copy(fontSize = 50.sp)
)
// Will this have a line height of 64, or will line height be "auto"?
• Override in
Type.kt
displayMedium = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.SemiBold
fontSize = 40.sp,
// don't set lineHeight
// don't set letterSpacing
),
...
Text(
text = ...,
MaterialTheme.typography.displayMedium
)
// Will this have a line height of 52, or something like Unspecified, which then means "auto"? Or...?
Our designers are taking advantage of Figma's ability to set line height to "auto"(which ends up being odd values like 51.74) and they ask, "Wait, you mean Android doesn't have auto line height?" So, does it?