From 6552a9b4f70c188d3d8c92c5ea91e866ff52dc98 Mon Sep 17 00:00:00 2001 From: Kyrylo Panin Date: Tue, 18 Jul 2023 17:31:46 +0300 Subject: [PATCH 1/2] Added SFPro --- Sources/SwiftRichString/Extensions/SystemFonts.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/SwiftRichString/Extensions/SystemFonts.swift b/Sources/SwiftRichString/Extensions/SystemFonts.swift index 6968ba9..9f602c1 100644 --- a/Sources/SwiftRichString/Extensions/SystemFonts.swift +++ b/Sources/SwiftRichString/Extensions/SystemFonts.swift @@ -299,6 +299,16 @@ public enum SystemFonts: String, FontConvertible { case EuphemiaUCAS_Italic = "EuphemiaUCAS-Italic" case EuphemiaUCAS_Bold = "EuphemiaUCAS-Bold" case DINCondensed_Bold = "DINCondensed-Bold" + case SFUIText = "SFUIText" + case SFUIText_UltraLight = "SFUIText-UltraLight" + case SFUIText_Thin = "SFUIText-Thin" + case SFUIText_Light = "SFUIText-Light" + case SFUIText_Medium = "SFUIText-Medium" + case SFUIText_Semibold = "SFUIText-Semibold" + case SFUIText_Bold = "SFUIText-Bold" + case SFUIText_Heavy = "SFUIText-Heavy" + case SFUIText_Black = "SFUIText-Black" + /// Transform value to a valid font instance. From 15c5ec95ccea11adc1b56fa7b098f63148742bcc Mon Sep 17 00:00:00 2001 From: Kyrylo Panin Date: Tue, 18 Jul 2023 18:27:48 +0300 Subject: [PATCH 2/2] Fix --- Sources/SwiftRichString/Extensions/SystemFonts.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftRichString/Extensions/SystemFonts.swift b/Sources/SwiftRichString/Extensions/SystemFonts.swift index 9f602c1..b15cb22 100644 --- a/Sources/SwiftRichString/Extensions/SystemFonts.swift +++ b/Sources/SwiftRichString/Extensions/SystemFonts.swift @@ -321,7 +321,7 @@ public enum SystemFonts: String, FontConvertible { #elseif os(watchOS) return Font(name: self.rawValue, size: (size ?? WATCHOS_SYSTEMFONT_SIZE))! #else - return Font(name: self.rawValue, size: (size ?? Font.systemFontSize))! + return Font(name: self.rawValue, size: (size ?? Font.systemFontSize)) ?? Font.systemFont(ofSize: size ?? Font.systemFontSize) #endif }