SwiftUI: Certain Text tracking value truncates text label

Originator:florian.alexander.schulz
Number:rdar://FB7650458 Date Originated:April 3rd, 2020
Status:open Resolved:
Product:SwiftUI Product Version:
Classification:Incorrect/Unexpected Behavior Reproducible:Always
 
When using a certain combination of text attributes (smallCaps, tracking, weight) in SwiftUI, the label text gets truncated.

Steps to reproduce:

VStack {

    // This works as expected.
    Text("Longer Text")
    .font(Font.system(.largeTitle).smallCaps())
    .fontWeight(.semibold)
    .tracking(15)

    // Here, the text gets truncated, even though there is
    // a smaller tracking value set, and there would be enough
    // space to show the complete text.
    Text("Longer Text")
    .font(Font.system(.largeTitle).smallCaps())
    .fontWeight(.semibold)
    .tracking(10)

    // This works as expected.
    Text("Longer Text")
    .font(Font.system(.largeTitle).smallCaps())
    .fontWeight(.semibold)
    .kerning(15)

    // This works as expected.
    Text("Longer Text")
    .font(Font.system(.largeTitle).smallCaps())
    .fontWeight(.semibold)
    .kerning(10)
}

I'm using Xcode 11.4, Swift 5.2, and tested in a Playground, on simulators (iOS 13.4), and an iPad (iOS 13.3.1).

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!