Compose SwiftUIv0.4.0
esc
GuideAPIGitHub
Structure

Font

A font value for text.

iOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
class Font

Overview

Prefer the text styles (Font.title, Font.body, Font.caption…): they follow Dynamic Type. Use Font.system(size =, weight =) for a fixed size.

This is the Kotlin form of SwiftUI Font: SwiftUI documentation. In Swift it reads:

@frozen struct Font

Topics

Initializers

constructor(value: Double)
SwiftUI Font.Width.init(_:)

Type properties

val largeTitle: Font
SwiftUI Font.largeTitle
val subheadline: Font
SwiftUI Font.subheadline
val body: Font
SwiftUI Font.body
val title: Font
SwiftUI Font.title
val title2: Font
SwiftUI Font.title2
val title3: Font
SwiftUI Font.title3
val callout: Font
SwiftUI Font.callout
val caption: Font
SwiftUI Font.caption
val default: Font
SwiftUI Font.default · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
val caption2: Font
SwiftUI Font.caption2
val footnote: Font
SwiftUI Font.footnote
val headline: Font
SwiftUI Font.headline
val monospaced: Font.Design
SwiftUI Font.Design.monospaced
val serif: Font.Design
SwiftUI Font.Design.serif
val default: Font.Design
SwiftUI Font.Design.default
val rounded: Font.Design
SwiftUI Font.Design.rounded
val loose: Font.Leading
SwiftUI Font.Leading.loose
val tight: Font.Leading
SwiftUI Font.Leading.tight
val standard: Font.Leading
SwiftUI Font.Leading.standard
val largeTitle: Font.TextStyle
SwiftUI Font.TextStyle.largeTitle
val subheadline: Font.TextStyle
SwiftUI Font.TextStyle.subheadline
val body: Font.TextStyle
SwiftUI Font.TextStyle.body
val title: Font.TextStyle
SwiftUI Font.TextStyle.title
val title2: Font.TextStyle
SwiftUI Font.TextStyle.title2
val title3: Font.TextStyle
SwiftUI Font.TextStyle.title3
val callout: Font.TextStyle
SwiftUI Font.TextStyle.callout
val caption: Font.TextStyle
SwiftUI Font.TextStyle.caption
val caption2: Font.TextStyle
SwiftUI Font.TextStyle.caption2
val footnote: Font.TextStyle
SwiftUI Font.TextStyle.footnote
val headline: Font.TextStyle
SwiftUI Font.TextStyle.headline
val ultraLight: Font.Weight
SwiftUI Font.Weight.ultraLight
val bold: Font.Weight
SwiftUI Font.Weight.bold
val thin: Font.Weight
SwiftUI Font.Weight.thin
val black: Font.Weight
SwiftUI Font.Weight.black
val heavy: Font.Weight
SwiftUI Font.Weight.heavy
val light: Font.Weight
SwiftUI Font.Weight.light
val medium: Font.Weight
SwiftUI Font.Weight.medium
val regular: Font.Weight
SwiftUI Font.Weight.regular
val semibold: Font.Weight
SwiftUI Font.Weight.semibold
val compressed: Font.Width
SwiftUI Font.Width.compressed
val expanded: Font.Width
SwiftUI Font.Width.expanded
val standard: Font.Width
SwiftUI Font.Width.standard
val condensed: Font.Width
SwiftUI Font.Width.condensed

Methods

fun monospaced(): Font
SwiftUI Font.monospaced()
fun monospaced(isActive: Boolean): Font
SwiftUI Font.monospaced(_:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun monospacedDigit(): Font
SwiftUI Font.monospacedDigit()
fun lowercaseSmallCaps(): Font
SwiftUI Font.lowercaseSmallCaps()
fun lowercaseSmallCaps(isActive: Boolean): Font
SwiftUI Font.lowercaseSmallCaps(_:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun uppercaseSmallCaps(): Font
SwiftUI Font.uppercaseSmallCaps()
fun uppercaseSmallCaps(isActive: Boolean): Font
SwiftUI Font.uppercaseSmallCaps(_:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun bold(): Font
SwiftUI Font.bold()
fun bold(isActive: Boolean): Font
SwiftUI Font.bold(_:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun width(width: Font.Width): Font
SwiftUI Font.width(_:)
fun italic(): Font
SwiftUI Font.italic()
fun italic(isActive: Boolean): Font
SwiftUI Font.italic(_:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun scaled(factor: Double): Font
SwiftUI Font.scaled(by:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun weight(weight: Font.Weight): Font
SwiftUI Font.weight(_:)
fun leading(leading: Font.Leading): Font
SwiftUI Font.leading(_:)
fun pointSize(size: Double): Font
SwiftUI Font.pointSize(_:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun smallCaps(): Font
SwiftUI Font.smallCaps()
fun smallCaps(isActive: Boolean): Font
SwiftUI Font.smallCaps(_:) · iOS 26.0+, macOS 26.0+, tvOS 26.0+, watchOS 26.0+
fun custom(name: String, size: Double, relativeTo: Font.TextStyle): Font
SwiftUI Font.custom(_:size:relativeTo:)
fun custom(name: String, size: Double): Font
SwiftUI Font.custom(_:size:)
fun system(size: Double, weight: Font.Weight = Font.Weight.regular, design: Font.Design = Font.Design.default): Font
SwiftUI Font.system(size:weight:design:)
fun system(style: Font.TextStyle, design: Font.Design? = null, weight: Font.Weight? = null): Font
SwiftUI Font.system(_:design:weight:)
fun system(style: Font.TextStyle, design: Font.Design = Font.Design.default): Font
SwiftUI Font.system(_:design:)

Types

class Font
SwiftUI Font
class Design
SwiftUI Font.Design
class Leading
SwiftUI Font.Leading
class TextStyle
SwiftUI Font.TextStyle
class Weight
SwiftUI Font.Weight
class Width
SwiftUI Font.Width