mattinger
01/26/2024, 9:05 PMprivate fun TextStyle.keepDefaultFontPadding(): TextStyle {
return TextStyle(
fontFamily = fontFamily,
fontWeight = fontWeight,
fontSize = fontSize,
lineHeight = lineHeight,
letterSpacing = letterSpacing,
platformStyle = platformStyle.keepDefaultFontPadding()
)
}
private fun PlatformTextStyle?.keepDefaultFontPadding() =
PlatformTextStyle(
spanStyle = this?.spanStyle ?: PlatformSpanStyle.Default,
paragraphStyle = PlatformParagraphStyle(
emojiSupportMatch = this?.paragraphStyle?.emojiSupportMatch ?: EmojiSupportMatch.Default,
includeFontPadding = true
)
)
However, while this seems to work for text paragraphs, it seems like single line text items are now different sizes. There’s a before and after of the paparazzi snapshot. You’ll notice that the padding on top of the $100 in the original is much smaller than the actual as is the size of the buttons. Nothing else about the code has changed other than the compose 1.6 update and the transformation above.Zach Klippenstein (he/him) [MOD]
01/26/2024, 10:50 PMAlbert Chang
01/27/2024, 3:48 AMTypography
, which wasn't before 1.6.mattinger
01/29/2024, 2:00 PMTextStyle(
fontFamily = XDSFonts.DMSans,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.00000.em
)
mattinger
01/29/2024, 2:01 PMZach Klippenstein (he/him) [MOD]
01/30/2024, 9:35 PMmattinger
01/31/2024, 5:40 PM