Skip to content

Commit

Permalink
Merge pull request #174 from DroidKaigi/takahirom/fix-text-theme/2024…
Browse files Browse the repository at this point in the history
…-07-28

Fix typography
  • Loading branch information
takahirom authored Jul 28, 2024
2 parents 704abe6 + 1d4382a commit 1ca212b
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 112 deletions.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sample">!!Please remove this resource when you add string resource!!</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sample">!!Please remove this resource when you add string resource!!</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.github.droidkaigi.confsched.designsystem

import conference_app_2024.core.designsystem.generated.resources.Res

object DesignSystemRes {
val drawable = Res.drawable
val string = Res.string
val font = Res.font
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ internal fun FontPreview() {
Column(
Modifier.background(color = Color.White),
) {
Text("Display Large", style = AppTypography.displayLarge)
Text("Display Medium", style = AppTypography.displayMedium)
Text("Display Small", style = AppTypography.displaySmall)
Text("Headline Large", style = AppTypography.headlineLarge)
Text("Headline Medium", style = AppTypography.headlineMedium)
Text("Headline Small", style = AppTypography.headlineSmall)
Text("Title Large", style = AppTypography.titleLarge)
Text("Title Medium", style = AppTypography.titleMedium)
Text("Title Small", style = AppTypography.titleSmall)
Text("Label Large", style = AppTypography.labelLarge)
Text("Label Medium", style = AppTypography.labelMedium)
Text("Label Small", style = AppTypography.labelSmall)
Text("Body Large", style = AppTypography.bodyLarge)
Text("Body Medium", style = AppTypography.bodyMedium)
Text("Body Small", style = AppTypography.bodySmall)
Text("Display Large", style = appTypography().displayLarge)
Text("Display Medium", style = appTypography().displayMedium)
Text("Display Small", style = appTypography().displaySmall)
Text("Headline Large", style = appTypography().headlineLarge)
Text("Headline Medium", style = appTypography().headlineMedium)
Text("Headline Small", style = appTypography().headlineSmall)
Text("Title Large", style = appTypography().titleLarge)
Text("Title Medium", style = appTypography().titleMedium)
Text("Title Small", style = appTypography().titleSmall)
Text("Label Large", style = appTypography().labelLarge)
Text("Label Medium", style = appTypography().labelMedium)
Text("Label Small", style = appTypography().labelSmall)
Text("Body Large", style = appTypography().bodyLarge)
Text("Body Medium", style = appTypography().bodyMedium)
Text("Body Small", style = appTypography().bodySmall)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ fun KaigiTheme(

MaterialTheme(
colorScheme = colorScheme,
typography = AppTypography,
typography = appTypography(),
content = content,
)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,114 @@
package io.github.droidkaigi.confsched.designsystem.theme

import androidx.compose.material3.Typography
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
import conference_app_2024.core.designsystem.generated.resources.dot_gothic16_regular
import io.github.droidkaigi.confsched.designsystem.DesignSystemRes
import org.jetbrains.compose.resources.Font

val AppTypography = Typography()
@Composable
fun appTypography(): Typography {
val dotGothic16 = FontFamily(
Font(DesignSystemRes.font.dot_gothic16_regular),
)
return remember(dotGothic16) {
Typography(
displayLarge = TextStyle(
fontFamily = dotGothic16,
fontSize = 57.sp,
lineHeight = 64.sp,
letterSpacing = (-0.25).sp,
),
displayMedium = TextStyle(
fontFamily = dotGothic16,
fontSize = 45.sp,
lineHeight = 52.sp,
letterSpacing = 0.sp,
),
displaySmall = TextStyle(
fontFamily = dotGothic16,
fontSize = 36.sp,
lineHeight = 44.sp,
letterSpacing = 0.sp,
),
headlineLarge = TextStyle(
fontFamily = dotGothic16,
fontSize = 32.sp,
lineHeight = 40.sp,
letterSpacing = 0.sp,
),
headlineMedium = TextStyle(
fontFamily = dotGothic16,
fontSize = 28.sp,
lineHeight = 36.sp,
letterSpacing = 0.sp,
),
headlineSmall = TextStyle(
fontFamily = dotGothic16,
fontSize = 24.sp,
lineHeight = 32.sp,
letterSpacing = 0.sp,
),
titleLarge = TextStyle(
fontFamily = dotGothic16,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp,
),
titleMedium = TextStyle(
fontFamily = dotGothic16,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.15.sp,
),
titleSmall = TextStyle(
fontFamily = dotGothic16,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.1.sp,
),
labelLarge = TextStyle(
fontFamily = dotGothic16,
fontWeight = FontWeight.Medium,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.1.sp,
),
labelMedium = TextStyle(
fontFamily = dotGothic16,
fontWeight = FontWeight.Medium,
fontSize = 12.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp,
),
labelSmall = TextStyle(
fontFamily = dotGothic16,
fontWeight = FontWeight.Medium,
fontSize = 11.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp,
),
bodyLarge = TextStyle(
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp,
),
bodyMedium = TextStyle(
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.25.sp,
),
bodySmall = TextStyle(
fontSize = 12.sp,
lineHeight = 16.sp,
letterSpacing = 0.4.sp,
),

)
}
}
Binary file not shown.

This file was deleted.

0 comments on commit 1ca212b

Please sign in to comment.