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

Stylianos Gakis

02/14/2023, 2:19 PM
Since material3.Typography does not give an option to provide a FontFamily for all fields, and the default value of Typography parameters are all internal
TypographyTokens
, is my best bet to override the font to do this?
Copy code
Typography(
  displayLarge = MaterialTheme.typography.displayLarge.copy(fontFamily = SansStandard),
  displayMedium = MaterialTheme.typography.displayMedium.copy(fontFamily = SansStandard),
  displaySmall = MaterialTheme.typography.displaySmall.copy(fontFamily = SansStandard),
  // and so on, for all options
)
Or is there some API I am missing?
s

s3rius

02/19/2023, 1:10 PM
I was looking into this a while ago, too. It seems this is indeed the best option at the moment.
d

David Corrado

02/21/2023, 8:25 PM
Created a feature request to make this easier if anyone else wants to +1 https://issuetracker.google.com/issues/270111243
5 Views