Glenn Henry
05/14/2025, 3:44 PMFont
for loading font from resources? It's a composable function and I can't invoke it in Type.kt file.
val Typography = Typography(
titleLarge = TextStyle(
fontFamily = FontFamily(Font(Res.font.russo_one)),
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp
)
)
This is the error message: @Composable invocations can only happen from the context of a @Composable function
.
My font files are placed in main/composeResources/font/russo_one.ttf
.