largeTitle
TypeScriptstatic get largeTitle(): FontSwift declarationstatic let largeTitle: FontA font with the large title text style.
struct · iOS 13.0+ · SDK 27.1
@frozen struct FontAn environment-dependent font. The system resolves a font's value at the time it uses the font in a given environment because ``Font`` is a late-binding token.
static get largeTitle(): FontSwift declarationstatic let largeTitle: FontA font with the large title text style.
monospaced(): FontSwift declarationfunc monospaced() -> FontReturns a fixed-width font from the same family as the base font. If there's no suitable font face in the same family, SwiftUI returns a default fixed-width font. The following example adds the `monospaced()` modifier to the default system font, then applies this font to a ``Text`` view: struct ContentView: View { let myFont = Font .system(size: 24) .monospaced() var body: some View { Text("Hello, world!") .font(myFont) .padding() .navigationTitle("Monospaced") } }  SwiftUI may provide different fixed-width replacements for standard user interface fonts (such as ``Font/title``, or a system font created with ``Font/system(_:design:)``) than for those same fonts when created by name with ``Font/custom(_:size:)``. The ``View/font(_:)`` modifier applies the font to all text within the view. To mix fixed-width text with other styles in the same `Text` view, use the ``Text/init(_:)-1a4oh`` initializer to use an appropropriately-styled <doc://com.apple.documentation/documentation/Foundation/AttributedString> for the text view's content. You can use the <doc://com.apple.documentation/documentation/Foundation/AttributedString/init(markdown:options:baseURL:)-52n3u> initializer to provide a Markdown-formatted string containing the backtick-syntax (\`…\`) to apply code voice to specific ranges of the attributed string. - Returns: A fixed-width font from the same family as the base font, if one is available, and a default fixed-width font otherwise.
monospaced30059(isActive: boolean): FontSwift declarationfunc monospaced(_ isActive: Bool) -> FontReturns a font adding or removing fixed-width design from the same family as the base font. If there's no suitable font face in the same family, SwiftUI returns a default font. The following example adds the `monospaced()` modifier to the default system font, then applies this font to a ``Text`` view: struct ContentView: View { let myFont = Font .system(size: 24) .monospaced(true) var body: some View { Text("Hello, world!") .font(myFont) .padding() .navigationTitle("Monospaced") } }  SwiftUI may provide different fixed-width replacements for standard user interface fonts (such as ``Font/title``, or a system font created with ``Font/system(_:design:)``) than for those same fonts when created by name with ``Font/custom(_:size:)``. The ``View/font(_:)`` modifier applies the font to all text within the view. To mix fixed-width text with other styles in the same `Text` view, use the ``Text/init(_:)-1a4oh`` initializer to use an appropriately-styled <doc://com.apple.documentation/documentation/Foundation/AttributedString> for the text view's content. You can use the <doc://com.apple.documentation/documentation/Foundation/AttributedString/init(markdown:options:baseURL:)-52n3u> initializer to provide a Markdown-formatted string containing the backtick-syntax (\`…\`) to apply code voice to specific ranges of the attributed string. - Returns: A font with the fixed-width design added or removed, from the same family as the base font, if one is available, and a default font otherwise.
static get subheadline(): FontSwift declarationstatic let subheadline: FontA font with the subheadline text style.
monospacedDigit(): FontSwift declarationfunc monospacedDigit() -> FontReturns a modified font that uses fixed-width digits, while leaving other characters proportionally spaced. This modifier only affects numeric characters, and leaves all other characters unchanged. If the base font doesn't support fixed-width, or _monospace_ digits, the font remains unchanged. The following example shows two text fields arranged in a ``VStack``. Both text fields specify the 12-point system font, with the second adding the `monospacedDigit()` modifier to the font. Because the text includes the digit 1, normally a narrow character in proportional fonts, the second text field becomes wider than the first. @State private var userText = "Effect of monospacing digits: 111,111." var body: some View { VStack { TextField("Proportional", text: $userText) .font(.system(size: 12)) TextField("Monospaced", text: $userText) .font(.system(size: 12).monospacedDigit()) } .padding() .navigationTitle(Text("Font + monospacedDigit()")) }  - Returns: A font that uses fixed-width numeric characters.
lowercaseSmallCaps(): FontSwift declarationfunc lowercaseSmallCaps() -> FontAdjusts the font to enable lowercase small capitals. This function turns lowercase characters into small capitals for the font. It is generally used for display lines set in large and small caps, such as titles. It may include forms related to small capitals, such as old-style figures.
lowercaseSmallCaps1507(isActive: boolean): FontSwift declarationfunc lowercaseSmallCaps(_ isActive: Bool) -> FontAdjusts the font to enable/disable lowercase small capitals. This function controls turning lowercase characters into small capitals for the font. It is generally used for display lines set in large and small caps, such as titles. It may include forms related to small capitals, such as old-style figures.
uppercaseSmallCaps(): FontSwift declarationfunc uppercaseSmallCaps() -> FontAdjusts the font to enable uppercase small capitals. This feature turns capital characters into small capitals. It is generally used for words which would otherwise be set in all caps, such as acronyms, but which are desired in small-cap form to avoid disrupting the flow of text.
uppercaseSmallCaps98364(isActive: boolean): FontSwift declarationfunc uppercaseSmallCaps(_ isActive: Bool) -> FontAdjusts the font to enable/disable uppercase small capitals. This feature controls turning capital characters into small capitals. It is generally used for words which would otherwise be set in all caps, such as acronyms, but which are desired in small-cap form to avoid disrupting the flow of text.
static get body(): FontSwift declarationstatic let body: FontA font with the body text style.
bold(): FontSwift declarationfunc bold() -> FontAdds bold or emphasized styling to the font. For fonts created from text styles, it could mean applying emphasized styling, which does not necessarily mean the bold weight specifically, so this modifier is not to be confused with <doc://com.apple.documentation/documentation/SwiftUI/Font/weight(_:)>. For example: Font.body.bold() will most likely get you the emphasized version of body text style, which is often in <doc://com.apple.documentation/documentation/SwiftUI/Font/weight/semibold> weight. While Font.body.weight(.bold) will specifically get you the body text style font in the <doc://com.apple.documentation/documentation/SwiftUI/Font/weight/bold> weight.
bold91310(isActive: boolean): FontSwift declarationfunc bold(_ isActive: Bool) -> FontAdds or removes bold or emphasized styling on the font. For fonts created from text styles, passing `true` could mean applying emphasized styling, which does not necessarily mean the bold weight specifically, so this modifier is not to be confused with <doc://com.apple.documentation/documentation/SwiftUI/Font/weight(_:)>. For example: Font.body.bold(true) will most likely get you the emphasized version of body text style, which is often in <doc://com.apple.documentation/documentation/SwiftUI/Font/weight/semibold> weight. While Font.body.weight(.bold) will specifically get you the body text style font in the <doc://com.apple.documentation/documentation/SwiftUI/Font/weight/bold> weight. Using: Font.body.bold(false) will remove any emphasized styling from the font returning to its default weight which is most likely but not guaranteed to be 0.0 or ``Weight/regular``.
static get title(): FontSwift declarationstatic let title: FontA font with the title text style.
width(width: Font_Width): FontSwift declarationfunc width(_ width: Font.Width) -> FontSets the width of the font.
static customSizeRelativeTo(name: string, size: number, textStyle: Font_TextStyle): FontSwift declarationstatic func custom(_ name: String, size: CGFloat, relativeTo textStyle: Font.TextStyle) -> FontCreate a custom font with the given `name` and `size` that scales relative to the given `textStyle`.
static customSize(name: string, size: number): FontSwift declarationstatic func custom(_ name: String, size: CGFloat) -> FontCreate a custom font with the given `name` and `size` that scales with the body text style.
static customFixedSize(name: string, fixedSize: number): FontSwift declarationstatic func custom(_ name: String, fixedSize: CGFloat) -> FontCreate a custom font with the given `name` and a fixed `size` that does not scale with Dynamic Type.
italic(): FontSwift declarationfunc italic() -> FontAdds italics to the font.
italic41867(isActive: boolean): FontSwift declarationfunc italic(_ isActive: Bool) -> FontAdds/removes italics on the font.
scaled(factor: number): FontSwift declarationfunc scaled(by factor: CGFloat) -> FontScales the point size of the font. Calls to scale are multiplicative, based on the size of the resolved font. For example, Font.body .scaled(by: 2) .bold() .scaled(by: 3) results in a bold body font 6x its usual size.
static systemSizeWeightDesign(size: number, weight?: Font_Weight, design?: Font_Design): FontSwift declarationstatic func system(size: CGFloat, weight: Font.Weight = .regular, design: Font.Design = .default) -> FontSpecifies a system font to use, along with the style, weight, and any design parameters you want applied to the text. Use this function to create a system font by specifying the size and weight, and a type design together. The following styles the system font as 17 point, ``Font/Weight/semibold`` text: Text("Hello").font(.system(size: 17, weight: .semibold)) While the following styles the text as 17 point ``Font/Weight/bold``, and applies a `serif` ``Font/Design`` to the system font: Text("Hello").font(.system(size: 17, weight: .bold, design: .serif)) If you want to use the default ``Font/Weight`` (``Font/Weight/regular``), you don't need to specify the `weight` in the method. The following example styles the text as 17 point ``Font/Weight/regular``, and uses a ``Font/Design/rounded`` system font: Text("Hello").font(.system(size: 17, design: .rounded)) This function has been deprecated, use the one with nullable `weight` and `design` instead.
static systemSizeWeightDesign6513(size: number, weight?: (Font_Weight) | null, design?: (Font_Design) | null): FontSwift declarationstatic func system(size: CGFloat, weight: Font.Weight? = nil, design: Font.Design? = nil) -> FontSpecifies a system font to use, along with the style, weight, and any design parameters you want applied to the text. Use this function to create a system font by specifying the size and weight, and a type design together. The following styles the system font as 17 point, ``Font/Weight/semibold`` text: Text("Hello").font(.system(size: 17, weight: .semibold)) While the following styles the text as 17 point ``Font/Weight/bold``, and applies a `serif` ``Font/Design`` to the system font: Text("Hello").font(.system(size: 17, weight: .bold, design: .serif)) Both `weight` and `design` can be optional. When you do not provide a `weight` or `design`, the system can pick one based on the current context, which may not be ``Font/Weight/regular`` or ``Font/Design/default`` in certain context. The following example styles the text as 17 point system font using ``Font/Design/rounded`` design, while its weight can depend on the current context: Text("Hello").font(.system(size: 17, design: .rounded))
static systemDesignWeight(style: Font_TextStyle, design?: (Font_Design) | null, weight?: (Font_Weight) | null): FontSwift declarationstatic func system(_ style: Font.TextStyle, design: Font.Design? = nil, weight: Font.Weight? = nil) -> FontGets a system font that uses the specified style, design, and weight. Use this method to create a system font that has the specified properties. The following example creates a system font with the ``TextStyle/body`` text style, a ``Design/serif`` design, and a ``Weight/bold`` weight, and applies the font to a ``Text`` view using the ``View/font(_:)`` view modifier: Text("Hello").font(.system(.body, design: .serif, weight: .bold)) The `design` and `weight` parameters are both optional. If you omit either, the system uses a default value for that parameter. The default values are typically ``Design/default`` and ``Weight/regular``, respectively, but might vary depending on the context.
static systemDesign(style: Font_TextStyle, design?: Font_Design): FontSwift declarationstatic func system(_ style: Font.TextStyle, design: Font.Design = .default) -> FontGets a system font with the given text style and design. This function has been deprecated, use the one with nullable `design` and `weight` instead.
static get title2(): FontSwift declarationstatic let title2: FontCreate a font for second level hierarchical headings.
static get title3(): FontSwift declarationstatic let title3: FontCreate a font for third level hierarchical headings.
weight(weight: Font_Weight): FontSwift declarationfunc weight(_ weight: Font.Weight) -> FontSets the weight of the font.
static get callout(): FontSwift declarationstatic let callout: FontA font with the callout text style.
static get caption(): FontSwift declarationstatic let caption: FontA font with the caption text style.
static get default(): FontSwift declarationstatic var `default`: Font { get }The effective SwiftUI font used in any given environment. The font specified by environment, preferring first any developer specified font, via ``EnvironmentValues/font``, then any framework specified font, and finally the default SwiftUI font.
leading(leading: Font_Leading): FontSwift declarationfunc leading(_ leading: Font.Leading) -> FontAdjusts the line spacing of a font. You can change a font's line spacing while maintaining other characteristics of the font by applying this modifier. For example, you can decrease spacing of the ``body`` font by applying the ``Leading/tight`` value to it: let myFont = Font.body.leading(.tight) The availability of leading adjustments depends on the font. For some fonts, the modifier has no effect and returns the original font. - Parameter leading: The line spacing adjustment to apply. - Returns: A modified font that uses the specified line spacing, or the original font if it doesn't support line spacing adjustments.
resolve(context: Font_Context): Font_ResolvedSwift declarationfunc resolve(in context: Font.Context) -> Font.ResolvedEvaluates this font to a resolved font given the current context. The system resolves a font's value at the time it uses the font in a given environment's context because ``Font`` is a late-binding token. - SeeAlso: ``EnvironmentValues/fontResolutionContext``
static get caption2(): FontSwift declarationstatic let caption2: FontCreate a font with the alternate caption text style.
static get footnote(): FontSwift declarationstatic let footnote: FontA font with the footnote text style.
static get headline(): FontSwift declarationstatic let headline: FontA font with the headline text style.
pointSize(size: number): FontSwift declarationfunc pointSize(_ size: CGFloat) -> FontSets the point size of the font explicitly. Setting the point size explicitly will result in style based fonts no longer scaling with the device's preferred text size. To scale a font's size relative to its current size, see ``Font/scaled(by:)``.
smallCaps(): FontSwift declarationfunc smallCaps() -> FontAdjusts the font to enable all small capitals. See ``Font/lowercaseSmallCaps()`` and ``Font/uppercaseSmallCaps()`` for more details.
smallCaps43824(isActive: boolean): FontSwift declarationfunc smallCaps(_ isActive: Bool) -> FontAdjusts the font to enable/disable all small capitals. See ``Font/lowercaseSmallCaps()`` and ``Font/uppercaseSmallCaps()`` for more details.
static init(font: _CoreText_CTFont): FontSwift declarationinit(_ font: CTFont)Creates a custom font from a platform font instance. Initializing ``Font`` with platform font instance (<doc://com.apple.documentation/documentation/CoreText/CTFont-q6r>) can bridge SwiftUI ``Font`` with <doc://com.apple.documentation/documentation/AppKit/NSFont> or <doc://com.apple.documentation/documentation/UIKit/UIFont>, both of which are toll-free bridged to <doc://com.apple.documentation/documentation/CoreText/CTFont-q6r>. For example: // Use native Core Text API to create desired ctFont. let ctFont = CTFontCreateUIFontForLanguage(.system, 12, nil)! // Create SwiftUI Text with the CTFont instance. let text = Text("Hello").font(Font(ctFont))
No declarations were skipped in this snapshot.