Typography
Font families, weights, dimensions, and semantic typography tokens.
FreakUI provides semantic Font tokens for titles, subtitles, body text, labels, captions, numbers, and icons. Text and numeric families are configured independently through FTypography.
Font dimensions
Every value is a point size. The default weight is semibold for titles, captions, and numbers, and regular for subtitles, body text, labels, and icons.
| Scale | Title | Subtitle | Body | Label | Caption | Number | Icon |
|---|---|---|---|---|---|---|---|
| 3XS | 13 | 8 | 8 | 8 | 8 | 10 | 12 |
| 2XS | 14 | 10 | 10 | 9 | 9 | 11 | 14 |
| XS | 15 | 11 | 11 | 10 | 10 | 12 | 16 |
| S | 17 | 12 | 12 | 11 | 11 | 14 | 20 |
| M | 18 | 15 | 14 | 13 | 12 | 16 | 24 |
| L | 20 | 17 | 15 | 15 | 14 | 20 | 28 |
| XL | 24 | 20 | 17 | 17 | 16 | 24 | 35 |
| 2XL | 32 | 24 | 20 | 19 | 18 | 28 | 40 |
| 3XL | 40 | 28 | 24 | 22 | 20 | 30 | 48 |
| 4XL | 48 | 32 | 28 | 26 | 24 | 32 | 64 |
Token names combine the family and scale, such as .titleM(), .bodyXL(), or .number2XL().
VStack(alignment: .leading, spacing: .paddingXS) {
Text("Monthly summary")
.font(.titleL())
Text("Updated just now")
.font(.captionM())
.foregroundStyle(.secondaryFont)
Text("$4,280")
.font(.number2XL(weight: .bold))
}
Weights
FFontWeight supports .regular, .medium, .semibold, and .bold. Pass a weight into any token rather than applying an unrelated SwiftUI font after the token.
Font families
FTypography.system uses the system text family and Apple's monospaced system design for numbers. A custom family requires all four PostScript faces.
let typography = FTypography(
textFamily: .custom(
FFontFaces(
regular: "Satoshi-Regular",
medium: "Satoshi-Medium",
semibold: "Satoshi-Semibold",
bold: "Satoshi-Bold"
)
),
numberFamily: .systemMonospaced
)
Register custom fonts in the client application before assigning the typography to FThemeManager.