Typography
On this page
Specifications references
Implementation in Jetpack Compose
As ODS library supports multi-theme, the available typography is managed by a class (OdsTypography
) which is instantiated by the theme itself. It has a default constructor with the values used by Orange.
The theme provides typography for the application which uses the ODS library. ODS library components relies on the OdsTypography
defined by the used theme.
Through the OdsTypography
class, you can set the fontFamily
which will be applied to the typography text styles and you can define text styles you want to be in capitals by adding it into the allCapsTextStyles
list.
We recommend you to use OdsText
composable and provide an OdsTextStyle
to display texts:
OdsText(
text = "Hello",
style = OdsTextStyle.BodyL,
)
However, you can directly use ODS typography in a Text
composable as shown below:
Text(
text = "Hello",
style = OdsTheme.typography.bodyL,
)
OdsText composable
ODS library also provides OdsText
composable which is here to simplify the code you write.
The two differences between OdsText
and Text
are:
OdsText
uses theme text colors automatically taking into account the parameters provided like theenabled
one,OdsText
takes directly anOdsTextSyle
as parameter and manage all caps text style if needed (anOdsTextStyle
can be set all caps in theOdsTypography
of the theme).
Example of use:
OdsText(
text = "Big title",
style = OdsTextStyle.HeadlineL
)