not work paragraphStyle in AttributedString

I tried to create a Text View using attributedString. I want to set the line height using paragraphStyle and return the Text, but paragraphStyle is not being applied. Why is that?

extension Text {
    init?(_ content: String, font: StyleType, color: Color = .ppBlack) {
        var attributedString = AttributedString(content)
        attributedString.font = Font.custom(font.fontWeight, fixedSize: font.fontSize)
        attributedString.foregroundColor = color

        let paragraphStyle = NSMutableParagraphStyle()
        paragraphStyle.minimumLineHeight = 16
        paragraphStyle.maximumLineHeight = 16
        paragraphStyle.lineSpacing = 0
        
        attributedString.mergeAttributes(.init([.paragraphStyle: paragraphStyle]))
        
        self = Text(attributedString)
    }
}

paragraphStyle is currently no supported in AttributedString in SwiftUI . Please file an enhancement request to enable paragraph styles for AttributedString in SwiftUI using Feedback Assistant Once you file the request, please post the FB number here.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

not work paragraphStyle in AttributedString
 
 
Q