Thread
#compose
    grandstaish

    grandstaish

    1 year ago
    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
    Colton Idle

    Colton Idle

    1 year ago
    Is this what you're looking for by chance? https://developer.android.com/jetpack/compose/themes#typography It shows
    val MyTypography = Typography(
        h1 = TextStyle(
            fontFamily = Rubik,
            fontWeight = FontWeight.W300,
            fontSize = 96.sp
        ),
    which sounds like what you want?
    grandstaish

    grandstaish

    1 year ago
    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
    Colton Idle

    Colton Idle

    1 year ago
    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.