For some fonts, the built-in line spacing is unpleasantly large.
SwiftUI gives us the Text
modifier .lineSpacing()
to adjust the spacing between lines of text (also called the leading, unrelated to leading/trailing). Its value specifies the number of points of additional spacing to place between consecutive lines of text, so that .lineSpacing(0)
results in no change. Unfortunately, it does not appear to respond to negative values; .lineSpacing(-10)
yields the same result as lineSpacing(0)
.
Does anyone know of a way to reduce line spacing in SwiftUI without resorting to UIKit?
UILabel
to reduce line height: https://mcmap.net/q/408868/-fix-line-spacing-in-custom-font-in-swiftui – Spitler_lineHeightMultiple
modifier – Piscator