diff --git a/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift b/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift index 84a029f..08d5fa6 100644 --- a/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift +++ b/Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift @@ -129,6 +129,10 @@ extension SwiftyMarkdown { 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..6ac4484 100644 --- a/Sources/SwiftyMarkdown/SwiftyMarkdown.swift +++ b/Sources/SwiftyMarkdown/SwiftyMarkdown.swift @@ -250,6 +250,9 @@ 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 if available. + public var ignoreDynamicFontSize : Bool = false + public var frontMatterAttributes : [String : String] { get { return self.lineProcessor.frontMatterAttributes