How to make italic rounded style system text in SwiftUI?

Viewed 163

It seems SwiftUI font italic modifier does not have an effect on text with the system font style.

Having a .font(.system()) makes .italic() not changing the font style any more. is there a workaround for this behavior?

.rounded design should still be there after applying an italic modifier.

        Text(sampleSentence)
            .italic() // <--- Does not work
            .font(.system(size: 20, weight: .regular, design: .rounded))
1 Answers

SF Pro Rounded, the font that gets used when you specify .rounded, doesn't support italics. From the documentation:

SF Pro Rounded and SF Compact Rounded support:

  • Uprights in nine weights — from Ultralight to Black

It doesn't say italics. Meanwhile, for SF Pro:

SF Pro and SF Compact support:

  • Nine weights — from Ultralight to Black — in both uprights and italics
Related