Is there a way to set the default font family or I...
# compose
t
Is there a way to set the default font family or I’ve to override in all “styles” (body1, h1, etc)?
f
t
hmmm, this doesn’t show up for me in the
Typography
from Material3 😕
s
@matvei
m
Hello 🙂 Typography exists in material3, but it has different semantical values, there's no more h1-h6 and similar, but stuff like
bodySmall
,
bodyLarge
. I'm not sure there's a public documentation representing this though @Nick Rout But you can find the definition here: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]androidx/compose/material3/Typography.kt;l=75?q=Typography.kt
t
@matvei thanks for the info, but that’s not really the question 😅 the questions is how to set the same font family for everything at once. In the Material2 version there’s a
defaultFontFamily
parameter in the
Typography
class that doesn’t exists in the Material3 version of it.
m
Oh, I see 🙂 Yeah that a good question, I will let Nick to chime in
n
But yeah, there's currently no
defaultFontFamily
in M3 Typography. Not entirely sure why to be honest but it sounds like a good feature request
t
Also right now I couldn’t find a way to “copy” the default implementation for each (titleLarge, titleMedium, etc) and just replace the font family, so basically I would have to create every component of the style just to replace the font 😕
n
Yeah, but you could probably get away with overriding only the styles your app uses
👍🏽 1
But I agree it would be nice to have a default