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

Conversation

Claes34
Copy link

@Claes34 Claes34 commented Aug 31, 2022

This PR adds a new ignoreDynamicFontSize property that is necessary if you want to set sizes for other styles then italic or bold without setting the fontName (you cannot get SFUI font via name).

Inspired by an old but still opened PR.

@Narayane
Copy link

@SimonFairbairn possible to include this PR in next release please?

Copy link

@leolobato leolobato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes only for the indentation.

@@ -128,6 +128,10 @@ extension SwiftyMarkdown {
} else {
font = UIFont.preferredFont(forTextStyle: textStyle)
}

if ignoreDynamicFontSize, let fontSize = fontSize {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be a good idea to fix indentation before merging?

@@ -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 if available.
public var ignoreDynamicFontSize : Bool = false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works and covers an genuine use case, but a better solution might be to use scaledFont(for:, maximumPointSize:) from UIFontMetrics on SwiftyMarkdown+iOS.swift instead?

@Narayane Narayane force-pushed the feature/ignore-dynamic-font-size branch from 40c26cd to f5a9f49 Compare November 16, 2022 18:14
@Narayane
Copy link

Hi @leolobato,
I have done your requested changes.
Thanks.

@Claes34
Copy link
Author

Claes34 commented Nov 18, 2022

Hi @leolobato,

I have done your requested changes.

Thanks.

Thanks Seb

@Narayane
Copy link

@leolobato possible to merge it plz?

@leolobato
Copy link

@Narayane I don't have write permission to this repository. Only @SimonFairbairn should be able to merge and by the number of open, unmerged PRs, I suspect he doesn't have time to maintain this library anymore.

I suggest you use your own fork with the fix on your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants