Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ignoreDynamicFontSize property for iOS #132

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Sources/SwiftyMarkdown/SwiftyMarkdown+iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 3 additions & 0 deletions Sources/SwiftyMarkdown/SwiftyMarkdown.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down