Skip to content

Commit 5a1c206

Browse files
authored
Use fontDescriptor for instantiating a UIFont from an existing UIFont
Workaround for issue https://openradar.appspot.com/6153065 related to iOS 13 SDK. When instantiating a system font from its name, the created font is always Times New Roman.
1 parent b0d317c commit 5a1c206

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SwiftRichString/Attributes/FontConvertible.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extension Font: FontConvertible {
6262
#elseif os(watchOS)
6363
return Font(name: self.fontName, size: (size ?? WATCHOS_SYSTEMFONT_SIZE))!
6464
#else
65-
return Font(name: self.fontName, size: (size ?? Font.systemFontSize))!
65+
return Font(descriptor: self.fontDescriptor, size: (size ?? Font.systemFontSize))
6666
#endif
6767
}
6868

0 commit comments

Comments
 (0)