---
title: "kerning(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/text/kerning(_:)"
---

# kerning(_:)

Sets the spacing, or kerning, between characters.

## Declaration

```swift
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

Return Value Text with the specified amount of kerning.

## Discussion

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.

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:

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.

important: If you add both the tracking(_:) and kerning(_:) modifiers to a view, the view applies the tracking and ignores the kerning.

## See Also

### Styling the view’s text

- [foregroundStyle(_:)](swiftui/text/foregroundstyle(_:).md)
- [bold()](swiftui/text/bold().md)
- [bold(_:)](swiftui/text/bold(_:).md)
- [italic()](swiftui/text/italic().md)
- [italic(_:)](swiftui/text/italic(_:).md)
- [strikethrough(_:color:)](swiftui/text/strikethrough(_:color:).md)
- [strikethrough(_:pattern:color:)](swiftui/text/strikethrough(_:pattern:color:).md)
- [underline(_:color:)](swiftui/text/underline(_:color:).md)
- [underline(_:pattern:color:)](swiftui/text/underline(_:pattern:color:).md)
- [monospaced(_:)](swiftui/text/monospaced(_:).md)
- [monospacedDigit()](swiftui/text/monospaceddigit().md)
- [tracking(_:)](swiftui/text/tracking(_:).md)
- [baselineOffset(_:)](swiftui/text/baselineoffset(_:).md)
- [Text.Case](swiftui/text/case.md)
- [Text.DateStyle](swiftui/text/datestyle.md)
