Closed LiYanan2004 closed 1 year ago
Add MarkdownFontGroup protocol for better experience when you want to modify multiple types of font.
MarkdownFontProvider
markdownFont(_:)
If you are using MarkdownFontProvider, you should migrate to MarkdownFontGroup.
MarkdownFontGroup
Define your font group:
struct MyCustomFontGroup: MarkdownFontGroup { var h1: Font { Font.largeTitle.weight(.black) } } extension MarkdownFontGroup where Self == MyCustomFontGroup { static var custom: MyCustomFontGroup { .init() } }
Attach the font group:
MarkdownView(...) .fontGroup(.custom)
Add MarkdownFontGroup protocol for better experience when you want to modify multiple types of font.
Deprecation
MarkdownFontProvider
has been deprecated.markdownFont(_:)
modifier has been deprecated.If you are using
MarkdownFontProvider
, you should migrate toMarkdownFontGroup
.Example
Define your font group:
Attach the font group: