Skip to main content
.fontWidth(width: FontWidth): Component;

Parameters

width
FontWidth
The font width value that adjusts horizontal scaling of the font.

Support

Usage

Compressed text for tight spaces

Text("Compressed Text")
    .fontWidth("compressed")
    .frame({ width: 100 })

Condensed text for labels

VStack([
    Text("LABEL")
        .fontWidth("condensed")
        .font(.caption)
        .foregroundStyle(Color("secondary")),
    Text("Main Content")
        .fontWidth("standard")
])