Page Summary

Specifications references


ODS library defines its own font style. The font associated to the style is defined in the theme set in the environment.

Apply font style on text

Apply the font style on text like this:

 TextField("A text field", text: $textToEdit).odsFont(.title3)

Apply font style on view

In the example below, the first text field has a font style set directly, while the font applied to the following container applies to all of the text views inside that container.

VStack {
    Text("Font applied to a text view.")

    VStack {
        Text("These two text views have the same font")
        Text("applied to their parent view.")