You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.
Feature request should extend the framework. If you found a bug, please issue a Bug Report
How should the feature work?
PDFAttributedText currently only accepts NSAttributedStrings. Swift's current bridging from AttributedString to NSAttributedString supports NSFont and NSColor, etc., but also supports SwiftUI's Font and Color. These attributes are currently ignored by TPPDF.
PDFAttributedText(text: NSAttributedString) could have a cousin PDFAttributedText(text: AttributedString) that understands the newer Color and Font attributes.
Instead, when converting a Swift AttributedString to NSAttributedString, the newer formatting is ignored. Only if NSFont and NSColor attributes are supplied to AttributedString does converting to NSAttributedString result in the expected formatting in the final PDF. Furthermore, NSAttributedString does not conform to Sendable (and likely won't), while AttributedString does. This will be an error in Swift 6.
TPPDF Environment
TPPDF version: 2.6.1 Xcode version: 26.2 Swift version: 5 or 6
Activity
philprime commentedon Jan 13, 2026
Thanks for raising this feature request. Will keep this around for someone to go for it.