diff --git a/composeApp/src/commonMain/composeResources/font/jetbrains_sans_bold.ttf b/composeApp/src/commonMain/composeResources/font/jetbrains_sans_bold.ttf new file mode 100644 index 000000000..cbb299e30 Binary files /dev/null and b/composeApp/src/commonMain/composeResources/font/jetbrains_sans_bold.ttf differ diff --git a/composeApp/src/commonMain/composeResources/font/jetbrains_sans_regular.ttf b/composeApp/src/commonMain/composeResources/font/jetbrains_sans_regular.ttf new file mode 100644 index 000000000..cc94847b7 Binary files /dev/null and b/composeApp/src/commonMain/composeResources/font/jetbrains_sans_regular.ttf differ diff --git a/composeApp/src/commonMain/composeResources/font/jetbrains_sans_semibold.ttf b/composeApp/src/commonMain/composeResources/font/jetbrains_sans_semibold.ttf new file mode 100644 index 000000000..a7831c7dc Binary files /dev/null and b/composeApp/src/commonMain/composeResources/font/jetbrains_sans_semibold.ttf differ diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioTheme.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioTheme.kt index b7cda5580..38c889144 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioTheme.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioTheme.kt @@ -14,9 +14,16 @@ import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.luminance import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.Density import androidx.compose.ui.unit.sp +import nuvio.composeapp.generated.resources.Res +import nuvio.composeapp.generated.resources.jetbrains_sans_bold +import nuvio.composeapp.generated.resources.jetbrains_sans_regular +import nuvio.composeapp.generated.resources.jetbrains_sans_semibold +import org.jetbrains.compose.resources.Font val LocalAppTheme = staticCompositionLocalOf { AppTheme.WHITE } @@ -64,104 +71,134 @@ private val NuvioDarkColors = darkColorScheme( onError = Color(0xFFFCE5EC), ) -private val NuvioTypography = Typography( - displayLarge = TextStyle( - fontSize = 38.sp, - lineHeight = 42.sp, - fontWeight = FontWeight.Black, - letterSpacing = (-1.2).sp, - ), - headlineLarge = TextStyle( - fontSize = 26.sp, - lineHeight = 30.sp, - fontWeight = FontWeight.ExtraBold, - letterSpacing = (-0.8).sp, - ), - titleLarge = TextStyle( - fontSize = 18.sp, - lineHeight = 24.sp, - fontWeight = FontWeight.Bold, - ), - titleMedium = TextStyle( - fontSize = 16.sp, - lineHeight = 20.sp, - fontWeight = FontWeight.SemiBold, - ), - bodyLarge = TextStyle( - fontSize = 15.sp, - lineHeight = 22.sp, - fontWeight = FontWeight.Medium, - ), - bodyMedium = TextStyle( - fontSize = 14.sp, - lineHeight = 20.sp, - fontWeight = FontWeight.Normal, - ), - labelLarge = TextStyle( - fontSize = 14.sp, - lineHeight = 18.sp, - fontWeight = FontWeight.SemiBold, - ), - labelMedium = TextStyle( - fontSize = 12.sp, - lineHeight = 14.sp, - fontWeight = FontWeight.Medium, - letterSpacing = 0.8.sp, - ), -) +private val JetBrainsSans: FontFamily + @Composable + get() = FontFamily( + Font(Res.font.jetbrains_sans_bold, FontWeight.Bold, FontStyle.Normal), + Font(Res.font.jetbrains_sans_semibold, FontWeight.SemiBold, FontStyle.Normal), + Font(Res.font.jetbrains_sans_regular, FontWeight.Normal, FontStyle.Normal), + ) -private val NuvioTypeTokens = NuvioTypeScale( - labelXs = TextStyle( - fontSize = 11.sp, - lineHeight = 14.sp, - fontWeight = FontWeight.Medium, - ), - labelSm = TextStyle( - fontSize = 12.sp, - lineHeight = 15.sp, - fontWeight = FontWeight.Medium, - ), - bodySm = TextStyle( - fontSize = 13.sp, - lineHeight = 18.sp, - fontWeight = FontWeight.Normal, - ), - bodyMd = TextStyle( - fontSize = 14.sp, - lineHeight = 20.sp, - fontWeight = FontWeight.Normal, - ), - bodyLg = TextStyle( - fontSize = 16.sp, - lineHeight = 22.sp, - fontWeight = FontWeight.Medium, - ), - titleSm = TextStyle( - fontSize = 18.sp, - lineHeight = 22.sp, - fontWeight = FontWeight.Bold, - ), - titleMd = TextStyle( - fontSize = 22.sp, - lineHeight = 26.sp, - fontWeight = FontWeight.Bold, - ), - titleLg = TextStyle( - fontSize = 28.sp, - lineHeight = 32.sp, - fontWeight = FontWeight.Bold, - ), - displaySm = TextStyle( - fontSize = 32.sp, - lineHeight = 36.sp, - fontWeight = FontWeight.ExtraBold, - ), - displayMd = TextStyle( - fontSize = 48.sp, - lineHeight = 52.sp, - fontWeight = FontWeight.ExtraBold, - ), -) +private val NuvioTypography: Typography + @Composable + get() = Typography( + displayLarge = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 38.sp, + lineHeight = 42.sp, + fontWeight = FontWeight.Bold, + letterSpacing = (-1.2).sp, + ), + headlineLarge = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 26.sp, + lineHeight = 30.sp, + fontWeight = FontWeight.SemiBold, + letterSpacing = (-0.8).sp, + ), + titleLarge = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 18.sp, + lineHeight = 24.sp, + fontWeight = FontWeight.SemiBold, + ), + titleMedium = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 16.sp, + lineHeight = 20.sp, + fontWeight = FontWeight.SemiBold, + ), + bodyLarge = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 15.sp, + lineHeight = 22.sp, + fontWeight = FontWeight.Normal, + ), + bodyMedium = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 14.sp, + lineHeight = 20.sp, + fontWeight = FontWeight.Normal, + ), + labelLarge = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 14.sp, + lineHeight = 18.sp, + fontWeight = FontWeight.SemiBold, + ), + labelMedium = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 12.sp, + lineHeight = 14.sp, + fontWeight = FontWeight.SemiBold, + letterSpacing = 0.8.sp, + ), + ) + +private val NuvioTypeTokens: NuvioTypeScale + @Composable + get() = NuvioTypeScale( + labelXs = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 11.sp, + lineHeight = 14.sp, + fontWeight = FontWeight.SemiBold, + ), + labelSm = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 12.sp, + lineHeight = 15.sp, + fontWeight = FontWeight.SemiBold, + ), + bodySm = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 13.sp, + lineHeight = 18.sp, + fontWeight = FontWeight.Normal, + ), + bodyMd = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 14.sp, + lineHeight = 20.sp, + fontWeight = FontWeight.Normal, + ), + bodyLg = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 16.sp, + lineHeight = 22.sp, + fontWeight = FontWeight.Normal, + ), + titleSm = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 18.sp, + lineHeight = 22.sp, + fontWeight = FontWeight.SemiBold, + ), + titleMd = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 22.sp, + lineHeight = 26.sp, + fontWeight = FontWeight.SemiBold, + ), + titleLg = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 28.sp, + lineHeight = 32.sp, + fontWeight = FontWeight.SemiBold, + ), + displaySm = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 32.sp, + lineHeight = 36.sp, + fontWeight = FontWeight.Bold, + ), + displayMd = TextStyle( + fontFamily = JetBrainsSans, + fontSize = 48.sp, + lineHeight = 52.sp, + fontWeight = FontWeight.Bold, + ), + ) private val NuvioRippleConfiguration = RippleConfiguration( color = Color.Black,