Skip to content

Commit 5628ad4

Browse files
committed
#92 Fixed cachedAttribute's font
1 parent 645efe1 commit 5628ad4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/SwiftRichString/Style/Style.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,9 @@ public class Style: StyleProtocol {
616616
// string to generate a single attributes dictionary for `NSAttributedString`.
617617
let fontAttributes = self.fontData?.attributes ?? [:]
618618
self.cachedAttributes = self.innerAttributes.merging(fontAttributes) { (_, new) in return new }
619+
if let font = self.fontData?.font {
620+
self.cachedAttributes?[.font] = font
621+
}
619622
return self.cachedAttributes!
620623
}
621624

0 commit comments

Comments
 (0)