https://kotlinlang.org logo
#compose
Title
# compose
c

Colton Idle

02/22/2021, 11:23 PM
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?
Copy code
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

02/23/2021, 7:28 AM
We have a similar setup (pretty much mirroring the Material implementation) and haven’t had any problems.
👍 1
s

Shakil Karim

02/23/2021, 10:11 AM
I think you are avoiding letterSpacing, I have similar setup but i use something like this where letterSpacing is coming form MaterialTheme.typography.body1
Copy code
@Composable
fun facrNormal16BodyText() =
        MaterialTheme.typography.body1.merge(
                TextStyle(
                        fontWeight = FontWeight.Normal,
                        textAlign = TextAlign.Center,
                        fontSize = 16.sp,
                        fontFamily = JOST
                )
        )
b

Bryan Herbst

02/23/2021, 2:12 PM
Yep, doing the same thing.
👍 1