Skip to content

Instantly share code, notes, and snippets.

@shumelchyk
Created May 5, 2023 15:58
Show Gist options
  • Save shumelchyk/8450933e176cd9044ead7bb38923a3b6 to your computer and use it in GitHub Desktop.
Save shumelchyk/8450933e176cd9044ead7bb38923a3b6 to your computer and use it in GitHub Desktop.
Customize font padding
@Composable
fun Typography.withoutFontPadding() = remember(this) {
val platformStyle = PlatformTextStyle(includeFontPadding = false)
this.copy(
display1 = this.display1.copy(platformStyle = platformStyle),
display2 = this.display2.copy(platformStyle = platformStyle),
display3 = this.display3.copy(platformStyle = platformStyle),
title1 = this.title1.copy(platformStyle = platformStyle),
title2 = this.title2.copy(platformStyle = platformStyle),
title3 = this.title3.copy(platformStyle = platformStyle),
body1 = this.body1.copy(platformStyle = platformStyle),
body2 = this.body2.copy(platformStyle = platformStyle),
button = this.button.copy(platformStyle = platformStyle),
caption1 = this.caption1.copy(platformStyle = platformStyle),
caption2 = this.caption2.copy(platformStyle = platformStyle),
caption3 = this.caption3.copy(platformStyle = platformStyle),
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment