<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Text/kerning(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4TextV7kerningyAC14CoreFoundation7CGFloatVF"
  },
  "title" : "kerning(_:)"
}
-->

# kerning(_:)

Sets the spacing, or kerning, between characters.

```
nonisolated func kerning(_ kerning: CGFloat) -> Text
```

## Parameters

`kerning`

The spacing to use between individual characters in
this text. Value of `0` sets the kerning to the system default value.

## Return Value

Text with the specified amount of kerning.

## Discussion

Kerning defines the offset, in points, that a text view should shift
characters from the default spacing. Use positive kerning to widen the
spacing between characters. Use negative kerning to tighten the spacing
between characters.

```
VStack(alignment: .leading) {
    Text("ABCDEF").kerning(-3)
    Text("ABCDEF")
    Text("ABCDEF").kerning(3)
}
```

The last character in the first case, which uses negative kerning,
experiences cropping because the kerning affects the trailing edge of
the text view as well.

![Three text views showing character groups, with progressively](images/com.apple.SwiftUI/SwiftUI-Text-kerning-1@2x.png)

Kerning attempts to maintain ligatures. For example, the Hoefler Text
font uses a ligature for the letter combination *ffl*, as in the word
*raffle*, shown here with a small negative and a small positive kerning:

![Two text views showing the word raffle in the Hoefler Text font, the](images/com.apple.SwiftUI/SwiftUI-Text-kerning-2@2x.png)

The *ffl* letter combination keeps a constant shape as the other letters
move together or apart. Beyond a certain point in either direction,
however, kerning does disable nonessential ligatures.

![Two text views showing the word raffle in the Hoefler Text font, the](images/com.apple.SwiftUI/SwiftUI-Text-kerning-3@2x.png)

> Important: If you add both the ``doc://com.apple.SwiftUI/documentation/SwiftUI/Text/tracking(_:)`` and
> ``doc://com.apple.SwiftUI/documentation/SwiftUI/Text/kerning(_:)`` modifiers to a view, the view applies the
> tracking and ignores the kerning.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)