From 1370fe17796ecab60dc8008b870dd1412bf3c594 Mon Sep 17 00:00:00 2001 From: Nicolas Fontaine Date: Wed, 31 Aug 2022 16:20:04 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20-=20adding=20`ignoreDynamicFont?= =?UTF-8?q?Size`=20property?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift | 4 ++++ Sources/SwiftyMarkdown/SwiftyMarkdown.swift | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift b/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift index 84a029f..bb1fafb 100644 --- a/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift +++ b/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift @@ -128,6 +128,10 @@ extension SwiftyMarkdown { } else { font = UIFont.preferredFont(forTextStyle: textStyle) } + + if ignoreDynamicFontSize, let fontSize = fontSize { + font = font.withSize(fontSize) + } if globalItalic, let italicDescriptor = font.fontDescriptor.withSymbolicTraits(.traitItalic) { font = UIFont(descriptor: italicDescriptor, size: fontSize ?? 0) diff --git a/Sources/SwiftyMarkdown/SwiftyMarkdown.swift b/Sources/SwiftyMarkdown/SwiftyMarkdown.swift index 1e9ef16..69c97b7 100644 --- a/Sources/SwiftyMarkdown/SwiftyMarkdown.swift +++ b/Sources/SwiftyMarkdown/SwiftyMarkdown.swift @@ -249,6 +249,9 @@ If that is not set, then the system default will be used. public var bullet : String = "・" public var underlineLinks : Bool = false + + /// **iOS only** : Setting this boolean to true will force using the exact size set for each style. + public var ignoreDynamicFontSize : Bool = false public var frontMatterAttributes : [String : String] { get { From e939e9c428d5ffc4ae334f1512036866c5e39c3d Mon Sep 17 00:00:00 2001 From: Nicolas Fontaine Date: Wed, 31 Aug 2022 16:23:23 +0200 Subject: [PATCH 2/4] More precise documentation --- Sources/SwiftyMarkdown/SwiftyMarkdown.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftyMarkdown/SwiftyMarkdown.swift b/Sources/SwiftyMarkdown/SwiftyMarkdown.swift index 69c97b7..a4bd2d6 100644 --- a/Sources/SwiftyMarkdown/SwiftyMarkdown.swift +++ b/Sources/SwiftyMarkdown/SwiftyMarkdown.swift @@ -250,7 +250,7 @@ If that is not set, then the system default will be used. public var underlineLinks : Bool = false - /// **iOS only** : Setting this boolean to true will force using the exact size set for each style. + /// **iOS only** : Setting this boolean to true will force using the exact size set for each style if available. public var ignoreDynamicFontSize : Bool = false public var frontMatterAttributes : [String : String] { From f5a9f492c6535618d262b41e432f277379f553a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien=20BALARD?= Date: Wed, 16 Nov 2022 19:13:52 +0100 Subject: [PATCH 3/4] try to fix indent --- Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift b/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift index bb1fafb..08d5fa6 100644 --- a/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift +++ b/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift @@ -128,10 +128,10 @@ extension SwiftyMarkdown { } else { font = UIFont.preferredFont(forTextStyle: textStyle) } - - if ignoreDynamicFontSize, let fontSize = fontSize { - font = font.withSize(fontSize) - } + + if ignoreDynamicFontSize, let fontSize = fontSize { + font = font.withSize(fontSize) + } if globalItalic, let italicDescriptor = font.fontDescriptor.withSymbolicTraits(.traitItalic) { font = UIFont(descriptor: italicDescriptor, size: fontSize ?? 0) From bd3cb1e7995f0c950f16338204fdbafcf93c3c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien=20BALARD?= Date: Wed, 16 Nov 2022 19:17:14 +0100 Subject: [PATCH 4/4] try to fix indent --- Sources/SwiftyMarkdown/SwiftyMarkdown.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/SwiftyMarkdown/SwiftyMarkdown.swift b/Sources/SwiftyMarkdown/SwiftyMarkdown.swift index a4bd2d6..6ac4484 100644 --- a/Sources/SwiftyMarkdown/SwiftyMarkdown.swift +++ b/Sources/SwiftyMarkdown/SwiftyMarkdown.swift @@ -249,9 +249,9 @@ If that is not set, then the system default will be used. public var bullet : String = "・" public var underlineLinks : Bool = false - - /// **iOS only** : Setting this boolean to true will force using the exact size set for each style if available. - public var ignoreDynamicFontSize : Bool = false + + /// **iOS only** : Setting this boolean to true will force using the exact size set for each style if available. + public var ignoreDynamicFontSize : Bool = false public var frontMatterAttributes : [String : String] { get {