is there a public way to turn a compose `FontFamil...
# compose
g
is there a public way to turn a compose
FontFamily
,
FontWeight
, and
FontStyle
into a platform
Typeface
? It looks like
TypefaceAdapter
is what I want but it’s internal
c
Is this what you're looking for by chance? https://developer.android.com/jetpack/compose/themes#typography It shows
Copy code
val MyTypography = Typography(
    h1 = TextStyle(
        fontFamily = Rubik,
        fontWeight = FontWeight.W300,
        fontSize = 96.sp
    ),
which sounds like what you want?
g
Not quite what I’m after, but I think what I want(ed) is probably quite a weird case that is atypical. I wanted to apply a compose
TextStyle
to a view-based
TextView
component. The only tricky part really was applying the right Typeface. In the end I nope’d out of that plan and did a more limited solution instead lol
c
I suppose you could just create a specific text composable that has all the attributes you need. So you'd have an H1Text and BodyText and SubBodyText and all of those would have the right combination of TypeStyle and Modifiers already set. So you and your team basically only have to use a small subset of composable anytime you want text on the screen.