From 7991e769cbd1a2fb7e9f51e4f9274ee00e6aa5fb Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 12 Aug 2021 15:08:01 +0530 Subject: [PATCH] common: add Manrope as a custom font --- .../dev/msfjarvis/claw/common/theme/Theme.kt | 19 +++++++++++++++++++ .../dev/msfjarvis/claw/common/theme/Theme.kt | 8 ++++++++ .../dev/msfjarvis/claw/common/theme/Theme.kt | 18 ++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 common/src/androidMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt create mode 100644 common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt diff --git a/common/src/androidMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt b/common/src/androidMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt new file mode 100644 index 00000000..26e03564 --- /dev/null +++ b/common/src/androidMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt @@ -0,0 +1,19 @@ +@file:JvmName("AndroidTheme") + +package dev.msfjarvis.claw.common.theme + +import androidx.compose.ui.text.font.Font +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import dev.msfjarvis.claw.common.R + +actual val manropeFontFamily = + FontFamily( + Font(R.font.manrope_bold, FontWeight.Bold), + Font(R.font.manrope_extrabold, FontWeight.ExtraBold), + Font(R.font.manrope_extralight, FontWeight.ExtraLight), + Font(R.font.manrope_light, FontWeight.Light), + Font(R.font.manrope_medium, FontWeight.Medium), + Font(R.font.manrope_regular, FontWeight.Normal), + Font(R.font.manrope_semibold, FontWeight.SemiBold), + ) diff --git a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt b/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt index f16807e9..fc6b9309 100644 --- a/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt +++ b/common/src/commonMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt @@ -1,10 +1,14 @@ package dev.msfjarvis.claw.common.theme import androidx.compose.material.MaterialTheme +import androidx.compose.material.Typography import androidx.compose.material.darkColors import androidx.compose.material.lightColors import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily + +expect val manropeFontFamily: FontFamily val titleColor = Color(0xFF7395D9) @@ -36,6 +40,10 @@ val darkColors = fun LobstersTheme(darkTheme: Boolean, children: @Composable () -> Unit) { MaterialTheme( colors = if (darkTheme) darkColors else lightColors, + typography = + Typography( + defaultFontFamily = manropeFontFamily, + ), content = children, ) } diff --git a/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt b/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt new file mode 100644 index 00000000..d6be073a --- /dev/null +++ b/common/src/desktopMain/kotlin/dev/msfjarvis/claw/common/theme/Theme.kt @@ -0,0 +1,18 @@ +@file:JvmName("DesktopTheme") + +package dev.msfjarvis.claw.common.theme + +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.platform.Font + +actual val manropeFontFamily = + FontFamily( + Font("font/manrope_bold.ttf", FontWeight.Bold), + Font("font/manrope_extrabold.ttf", FontWeight.ExtraBold), + Font("font/manrope_extralight.ttf", FontWeight.ExtraLight), + Font("font/manrope_light.ttf", FontWeight.Light), + Font("font/manrope_medium.ttf", FontWeight.Medium), + Font("font/manrope_regular.ttf", FontWeight.Normal), + Font("font/manrope_semibold.ttf", FontWeight.SemiBold), + )