Font
An environment-dependent font.
Declaration
type Font =
| 'body'
| 'callout'
| 'caption'
| 'caption2'
| 'default'
| 'footnote'
| 'headline'
| 'largeTitle'
| 'subheadline'
| 'title'
| 'title2'
| 'title3'
| { custom: { name: string; fixedSize: number; }; }
| { custom: { name: string; size: number; }; }
| { custom: { name: string; size: number; relativeTo: FontTextStyle; }; }
| { system: { size: number; weight?: FontWeight | null; design?: FontDesign | null; }; }
| { system: { style: FontTextStyle; design?: FontDesign | null; weight?: FontWeight | null; }; }
| FontChain;@frozen struct FontPass a literal, or build one with SwiftUI.Font from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'body'SwiftUI.Font.bodyA font with the body text style.
'callout'SwiftUI.Font.calloutA font with the callout text style.
'caption'SwiftUI.Font.captionA font with the caption text style.
'caption2'SwiftUI.Font.caption2Create a font with the alternate caption text style.
'default'SwiftUI.Font.defaultThe effective SwiftUI font used in any given environment.
'footnote'SwiftUI.Font.footnoteA font with the footnote text style.
'headline'SwiftUI.Font.headlineA font with the headline text style.
'largeTitle'SwiftUI.Font.largeTitleA font with the large title text style.
'subheadline'SwiftUI.Font.subheadlineA font with the subheadline text style.
'title'SwiftUI.Font.titleA font with the title text style.
'title2'SwiftUI.Font.title2Create a font for second level hierarchical headings.
'title3'SwiftUI.Font.title3Create a font for third level hierarchical headings.
Type methods
Overview
The system resolves a font's value at the time it uses the font in a given
environment because Font is a late-binding token.
From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
See also
More in Text and symbols.
- DisabledTextSelectabilityA selectability type that disables text selection by the person using your app.
- EnabledTextSelectabilityA selectability type that enables text selection by the person using your app.
- FindContextThe status of the find navigator for views which support text editing.
- FixedTextVariantThe default text variant preference that chooses the largest available variant.
- FontChainFont with chained calls: SwiftUI.Font.bold(...).
- FontContextInformation used to resolve a font.
- FontDesignA design to use for fonts.
- FontLeadingA line spacing adjustment that you can apply to a font.
- FontWeightA weight to use for fonts.
- FontWidthA width to use for fonts that have multiple widths.
- SubmitLabelA semantic label describing the label of submission within a view hierarchy.
- SubmitTriggersA type that defines various triggers that result in the firing of a submission action.