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.

ScaleTitleSubtitleBodyLabelCaptionNumberIcon
3XS1388881012
2XS141010991114
XS15111110101216
S17121211111420
M18151413121624
L20171515142028
XL24201717162435
2XL32242019182840
3XL40282422203048
4XL48322826243264

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.