diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ElementTypography.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ElementTypography.kt index b2159522c8..a70846e074 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ElementTypography.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ElementTypography.kt @@ -16,6 +16,7 @@ package io.element.android.libraries.designsystem.theme +import androidx.compose.ui.text.PlatformTextStyle import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight @@ -107,3 +108,13 @@ val titleMediumDefault: TextStyle = TextStyle( letterSpacing = 0.5.sp ) +// Temporary style for text that needs to be aligned without weird font padding issues. `includeFontPadding` will default to false in a future version of +// compose, at which point this can be removed. +// +// Ref: https://medium.com/androiddevelopers/fixing-font-padding-in-compose-text-768cd232425b +@Suppress("DEPRECATION") +val noFontPadding: TextStyle = TextStyle( + platformStyle = PlatformTextStyle( + includeFontPadding = false + ) +)