Alwin Varghese
10/04/2024, 9:53 AMmatesc_regular.ttf
to the /composeApp/src/commonMain/composeResources/drawable/font
folder.
how do i create import this font Particulars.kt
to create a fontFamily
instance?Blaž Vantur
10/04/2024, 10:08 AMcomposeResources/font
directory. Then you can access it Res.font.
but I think you need to build your project first to make them available to you.Alwin Varghese
10/04/2024, 10:34 AMBlaž Vantur
10/04/2024, 10:36 AMimport org.jetbrains.compose.resources.Font
Alwin Varghese
10/04/2024, 10:37 AM@Composable invocations can only happen from the context of a @Composable function
Blaž Vantur
10/04/2024, 10:40 AM@Composable
private fun interFamily() = FontFamily(
Font(Res.font.matesc_regular, FontWeight.Normal)
)
Or you can also defined it in this way if you want to keep a variable:
val interFamily: FontFamily
@Composable get() = FontFamily(
Font(Res.font.matesc_regular, FontWeight.Normal)
)
Alwin Varghese
10/04/2024, 10:48 AM