ScaledFont icon indicating copy to clipboard operation
ScaledFont copied to clipboard

ScaledFont doesn't work with iOS 15's AttributedString/Markdown

Open jgale opened this issue 3 years ago • 1 comments

I just discovered that ScaledFont doesn't work with the new iOS 15 AttributedString/Markdown support. It just uses the same font for the whole string.

I'm not sure if it's reasonable to expect it would, given that we are specifying what exact font to use in the plist, I supposed it would probably need a different API. I just thought I'd get your thoughts on this.

Works:

struct ContentView: View {
    var body: some View {
        Text("**Depart:** 4:30 PM")
            .font(.subheadline)
    }
}

Doesn't work:

struct ContentView: View {
    var body: some View {
        Text("**Depart:** 4:30 PM")
            .scaledFont(.subheadline)
    }
}

jgale avatar Feb 09 '22 22:02 jgale

Thanks, that's interesting. Will need to investigate what's going on and see what if anything can be done,

kharrison avatar Feb 10 '22 10:02 kharrison