Skip to content

Commit

Permalink
Add custom typography
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowsky committed May 20, 2024
1 parent 8d2ad78 commit 0891fea
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.patrykandpatryk.liftapp.core.ui.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MaterialTheme.shapes
import androidx.compose.material3.Typography
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
Expand Down Expand Up @@ -97,7 +98,7 @@ fun LiftAppTheme(
CompositionLocalProvider(LocalDimens provides dimens) {
MaterialTheme(
colorScheme = colorScheme,
typography = Typography(),
typography = LiftAppTypography,
shapes = Shapes,
) {
ProvideChartStyle(chartStyle = chartStyle, content = content)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.patrykandpatryk.liftapp.core.ui.theme

import androidx.compose.material3.Typography
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import com.patrykandpatryk.liftapp.core.R

private val lexendFontFamily = FontFamily(
Font(R.font.lexend_regular, FontWeight.Normal),
Font(R.font.lexend_medium, FontWeight.Medium),
Font(R.font.lexend_semibold, FontWeight.SemiBold),
Font(R.font.lexend_bold, FontWeight.Bold),
)

private val manropeFontFamily = FontFamily(
Font(R.font.manrope_regular, FontWeight.Normal),
Font(R.font.manrope_medium, FontWeight.Medium),
Font(R.font.manrope_semibold, FontWeight.SemiBold),
)

val LiftAppTypography = Typography().run {
copy(
headlineLarge = headlineLarge.copy(fontFamily = lexendFontFamily),
headlineMedium = headlineMedium.copy(fontFamily = lexendFontFamily),
headlineSmall = headlineSmall.copy(fontFamily = lexendFontFamily),
displayLarge = displayLarge.copy(fontFamily = lexendFontFamily),
displayMedium = displayMedium.copy(fontFamily = lexendFontFamily),
displaySmall = displaySmall.copy(fontFamily = lexendFontFamily),
titleLarge = titleLarge.copy(fontFamily = lexendFontFamily),
titleMedium = titleMedium.copy(fontFamily = lexendFontFamily),
titleSmall = titleSmall.copy(fontFamily = lexendFontFamily),
bodyLarge = bodyLarge.copy(fontFamily = manropeFontFamily, fontWeight = FontWeight.Medium),
bodyMedium = bodyMedium.copy(fontFamily = manropeFontFamily, fontWeight = FontWeight.Medium),
bodySmall = bodySmall.copy(fontFamily = manropeFontFamily, fontWeight = FontWeight.Medium),
labelLarge = labelLarge.copy(fontFamily = manropeFontFamily, fontWeight = FontWeight.Bold),
labelMedium = labelMedium.copy(fontFamily = manropeFontFamily, fontWeight = FontWeight.Bold),
labelSmall = labelSmall.copy(fontFamily = manropeFontFamily, fontWeight = FontWeight.Bold),
)
}
Binary file added core/src/main/res/font/lexend_bold.ttf
Binary file not shown.
Binary file added core/src/main/res/font/lexend_medium.ttf
Binary file not shown.
Binary file added core/src/main/res/font/lexend_regular.ttf
Binary file not shown.
Binary file added core/src/main/res/font/lexend_semibold.ttf
Binary file not shown.
Binary file added core/src/main/res/font/manrope_medium.ttf
Binary file not shown.
Binary file added core/src/main/res/font/manrope_regular.ttf
Binary file not shown.
Binary file added core/src/main/res/font/manrope_semibold.ttf
Binary file not shown.

0 comments on commit 0891fea

Please sign in to comment.