-
Notifications
You must be signed in to change notification settings - Fork 485
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hello,
Thanks for maintaining this library. We are facing an issue with the dynamic text scaling and custom fonts whenever we try to use the library after the latest update 2.3.1. In the latest release there is this following PR that adjusts the use of "setting the dynamic text twice". As seen below in the images the when using the markdownTheme in the green box it doesnt change the size of the text while the user is changing the text size.
The project:
We use the following SwiftUI view as an example:
struct ContentView: View {
let text = """
### Hello, world!
This is text
"""
var body: some View {
VStack(spacing: 10) {
Text(text) // This should only display the text without any changes for the sake of sanity checks
.font(.custom("menlo", size: size))
.background(Color.red)
Markdown(MarkdownContent(text)) // This renders the markdown properly
.markdownTextStyle {
FontFamily(.custom("menlo"))
FontSize(size)
}
.background(Color.blue)
Markdown(MarkdownContent(text)) // This fails to render the markdown properly
.markdownTheme(.markdownTheme)
.background(Color.green)
}
.padding()
}
}Theme:
extension Theme {
static let markdownTheme = Theme()
.heading3 { config in
config.label
.markdownTextStyle {
FontFamily(.custom("menlo"))
FontSize(28)
}
}
.paragraph { config in
config.label
.markdownTextStyle {
FontFamily(.custom("menlo"))
FontSize(size)
}
}
.text {
FontFamily(.custom("menlo"))
FontSize(size)
}
}Screenshots:
Default Sized text:
When user sets text bigger:
Screenshots from 2.3.0:
Default Sized text:
When user sets text bigger:
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working



