Colton Idle

    Colton Idle

    1 year ago
    Hello! My team has a custom type scale and therefore we're not using the material type system. Is there anything wrong with this code or is this pretty much how you set it up?
    private val Lato = FontFamily(
        Font(R.font.lato_regular, FontWeight.Normal),
        Font(R.font.lato_bold, FontWeight.Bold),
    )
    
    object MyTypeSystem {
        val head = TextStyle(
            fontFamily = Lato,
            fontSize = 18.sp,
            fontWeight = FontWeight.Normal
        )
        val body = TextStyle(
            fontFamily = Lato,
            fontSize = 12.sp,
            fontWeight = FontWeight.Bold
        )
    ...
    }
    j

    justasm

    1 year ago
    We have a similar setup (pretty much mirroring the Material implementation) and haven’t had any problems.
    Shakil Karim

    Shakil Karim

    1 year ago
    I think you are avoiding letterSpacing, I have similar setup but i use something like this where letterSpacing is coming form MaterialTheme.typography.body1
    @Composable
    fun facrNormal16BodyText() =
            MaterialTheme.typography.body1.merge(
                    TextStyle(
                            fontWeight = FontWeight.Normal,
                            textAlign = TextAlign.Center,
                            fontSize = 16.sp,
                            fontFamily = JOST
                    )
            )
    Bryan Herbst

    Bryan Herbst

    1 year ago
    Yep, doing the same thing.