URL to the font file. Supports
.ttf and .otf formats.The font family name, as defined in the font file metadata.
Font size in points.
A semantic text style (e.g.
"body", "headline") to scale the font size relative to for Dynamic Type support. When set, the font scales with the user’s accessibility text size preference.Support
Usage
Basic custom font
With Dynamic Type scaling
Multiple weights
Notes
- The font file must be accessible from the provided URL at runtime.
- Supported formats are
.ttfand.otf. CustomFontreturns aFontComponentthat is passed to the.font()modifier, not used as a standalone view.- When
relativeToTextStyleis set, the font size scales with the user’s Dynamic Type preference, providing accessibility support.
See Also
- Text — text display