Customize the font
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
package com.ericampire.android.androidstudycase.presentation.theme
|
||||
|
||||
import androidx.compose.ui.text.font.Font
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import com.ericampire.android.androidstudycase.R
|
||||
|
||||
|
||||
val Roboto = FontFamily(
|
||||
Font(
|
||||
resId = R.font.roboto_black,
|
||||
weight = FontWeight.Black
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_bold,
|
||||
weight = FontWeight.Bold
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_black_italic,
|
||||
weight = FontWeight.Black,
|
||||
style = FontStyle.Italic
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_italic,
|
||||
style = FontStyle.Italic
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_light,
|
||||
weight = FontWeight.Light
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_light_italic,
|
||||
weight = FontWeight.Light,
|
||||
style = FontStyle.Italic
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_bold_italic,
|
||||
weight = FontWeight.Bold,
|
||||
style = FontStyle.Italic,
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_medium_italic,
|
||||
weight = FontWeight.Medium,
|
||||
style = FontStyle.Italic,
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_medium,
|
||||
weight = FontWeight.Medium,
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_thin,
|
||||
weight = FontWeight.Thin,
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_thin_italic,
|
||||
weight = FontWeight.Thin,
|
||||
style = FontStyle.Italic,
|
||||
),
|
||||
Font(
|
||||
resId = R.font.roboto_regular,
|
||||
weight = FontWeight.Normal,
|
||||
style = FontStyle.Normal,
|
||||
),
|
||||
)
|
||||
+13
-2
@@ -6,11 +6,18 @@ import androidx.compose.material.darkColors
|
||||
import androidx.compose.material.lightColors
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import com.google.accompanist.insets.ProvideWindowInsets
|
||||
|
||||
private val DarkColorPalette = darkColors(
|
||||
primary = AppColor.Purple200,
|
||||
primaryVariant = AppColor.Purple700,
|
||||
secondary = AppColor.Teal200
|
||||
secondary = AppColor.Teal200,
|
||||
background = Color.Black,
|
||||
surface = Color.Black,
|
||||
onPrimary = Color.Black,
|
||||
onSecondary = Color.White,
|
||||
onBackground = Color.White,
|
||||
onSurface = Color.White,
|
||||
)
|
||||
|
||||
private val LightColorPalette = lightColors(
|
||||
@@ -40,6 +47,10 @@ fun AndroidStudyCaseTheme(
|
||||
colors = colors,
|
||||
typography = Typography,
|
||||
shapes = Shapes,
|
||||
content = content
|
||||
content = {
|
||||
ProvideWindowInsets {
|
||||
content()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
+53
-14
@@ -2,26 +2,65 @@ package com.ericampire.android.androidstudycase.presentation.theme
|
||||
|
||||
import androidx.compose.material.Typography
|
||||
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
|
||||
|
||||
val Typography = Typography(
|
||||
body1 = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
subtitle1 = TextStyle(
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp
|
||||
)
|
||||
/* Other default text styles to override
|
||||
fontSize = 14.sp,
|
||||
letterSpacing = 0.15.sp
|
||||
),
|
||||
subtitle2 = TextStyle(
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 14.sp,
|
||||
letterSpacing = 0.1.sp
|
||||
),
|
||||
body1 = TextStyle(
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 14.sp
|
||||
),
|
||||
button = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.W500,
|
||||
fontSize = 14.sp
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.W500,
|
||||
fontSize = 12.sp
|
||||
),
|
||||
caption = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 12.sp
|
||||
)
|
||||
*/
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 10.sp
|
||||
),
|
||||
h1 = TextStyle(
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 26.sp
|
||||
),
|
||||
h2 = TextStyle(
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 24.sp
|
||||
),
|
||||
h3 = TextStyle(
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.ExtraBold,
|
||||
fontSize = 20.sp
|
||||
),
|
||||
h4 = TextStyle(
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 18.sp
|
||||
),
|
||||
h5 = TextStyle(
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 16.sp
|
||||
),
|
||||
h6 = TextStyle(
|
||||
fontFamily = Roboto,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 14.sp
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user