Set weight for bold fonts

This commit is contained in:
Nate Weaver 2020-04-30 17:08:14 -05:00
parent d47767d8b4
commit 406a8e0cc0
1 changed files with 3 additions and 0 deletions

View File

@ -223,6 +223,9 @@ extension NSAttributedString {
var symbolicTraits = currentDescriptor.symbolicTraits
if styles.contains(.bold) {
let traits: [FontDescriptor.TraitKey: Any] = [.weight: Font.Weight.bold]
let attributes: [FontDescriptor.AttributeName: Any] = [.traits: traits]
descriptor = descriptor.addingAttributes(attributes)
symbolicTraits.insert(boldTrait)
}