swift-markdown-ui icon indicating copy to clipboard operation
swift-markdown-ui copied to clipboard

SwiftUI Dynamic Type Size Question

Open chaseklingelzen opened this issue 1 year ago • 0 comments

Thank you for contributing to MarkdownUI!

Before you submit an issue, please complete the report with all the relevant details for your bug and go through every item in the checklist.

Describe the bug

First off, this is a pretty incredible library! Thank you for all the hard work on it. We'd like to use this in our SwiftUI project, but are currently wrestling with issues around dynamic type size.

Video demonstrating the issue:

https://github.com/gonzalezreal/swift-markdown-ui/assets/94926620/0f66b2b0-04af-4c0e-962c-9d7d362e7434

struct ContentView: View {
    var body: some View {
        Markdown("You may be excluded from filing a Beneficial Owner Report if your company is one of the following. Check out the [FinCEN Beneficial Ownership Guide](https://www.fincen.gov/sites/default/files/shared/BOI_Small_Compliance_Guide.v1.1-FINAL.pdf) if you think you may be exempt.")
            .markdownTextStyle {
                FontSize(12)
            }


    Text("You may be excluded from filing a Beneficial Owner Report if your company is one of the following. Check out the [FinCEN Beneficial Ownership Guide](https://www.fincen.gov/sites/default/files/shared/BOI_Small_Compliance_Guide.v1.1-FINAL.pdf) if you think you may be exempt.")
        .font(.system(size: 12))
    }
}

It seems that Markdown and Text view increase/decrease dramatically different. I would expect that they scale proportionally. I've tried this across several different iOS simulators. Can you help me understand why they don't scale proportionally?

Any help here is greatly appreciated!

Checklist

  • [x] I can reproduce this issue with a vanilla SwiftUI project.
  • [x] I can reproduce this issue using the main branch of this package.
  • [x] This bug hasn't been addressed in an existing GitHub issue.

Steps to reproduce Explanation of how to reproduce the incorrect behavior. This could include an attached project, a link to code, or a Markdown-formatted text exhibiting the issue.

  1. Download this zip
  2. Launch the app
  3. Increase/Decrease dynamic type size w/ cmd + option + "+" / cmd + option + "-"

Markdown-Testing.zip

Expected behavior

Markdown and Text view would scale proportionally when increasing/decreasing dynamic type size.

Screenshots

Same video as above:

https://github.com/gonzalezreal/swift-markdown-ui/assets/94926620/0f66b2b0-04af-4c0e-962c-9d7d362e7434

Version information

  • MarkdownUI: 2.3.0
  • OS: iPhone 15 Pro (17.2), iPhone 13 min (17.0), several others
  • Xcode: 15.2

Additional context Add any other context about the problem here.

chaseklingelzen avatar Feb 16 '24 23:02 chaseklingelzen