79806265

Date: 2025-10-31 23:19:40
Score: 0.5
Natty:
Report link

In case this is useful to someone starting with a bunch of Material Typography. You can make the getter for the Typography val @Composable, and then use dimen resources just like in traditional Android. Useful if your project is a mix of Compose and xml.

in theme.Type.kt


val Typography
@Composable
get() = Typography(
    bodyLarge = TextStyle(
        fontFamily = ibmFamily,
        fontSize = dimensionResource(R.dimen.lgtext).value.sp,
        lineHeight = dimensionResource(R.dimen.lgtext).value.sp,
        letterSpacing = 0.sp
    ),
    bodyMedium = TextStyle(
        fontFamily = ibmFamily,
        fontSize = 16.sp,
        lineHeight = 21.sp,
        letterSpacing = 0.sp
    ),
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Composable
  • Low reputation (0.5):
Posted by: alr3000