From 9a8119b37e09a770367eeb26e05267c75d854053 Mon Sep 17 00:00:00 2001 From: Guille Gonzalez Date: Sun, 16 Jun 2024 10:48:02 +0200 Subject: [PATCH] Fix custom font dynamic size (#330) * Calling `fixedSize` constructor for dynamic type * Fix tests --------- Co-authored-by: Mike Lewis --- .../MarkdownUI/Theme/TextStyle/Styles/Font+FontProperties.swift | 2 +- Tests/MarkdownUITests/FontPropertiesTests.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/MarkdownUI/Theme/TextStyle/Styles/Font+FontProperties.swift b/Sources/MarkdownUI/Theme/TextStyle/Styles/Font+FontProperties.swift index 85301413..e2b97511 100644 --- a/Sources/MarkdownUI/Theme/TextStyle/Styles/Font+FontProperties.swift +++ b/Sources/MarkdownUI/Theme/TextStyle/Styles/Font+FontProperties.swift @@ -9,7 +9,7 @@ extension Font { case .system(let design): font = .system(size: size, design: design) case .custom(let name): - font = .custom(name, size: size) + font = .custom(name, fixedSize: size) } switch fontProperties.familyVariant { diff --git a/Tests/MarkdownUITests/FontPropertiesTests.swift b/Tests/MarkdownUITests/FontPropertiesTests.swift index 58ce8b8f..45ca6411 100644 --- a/Tests/MarkdownUITests/FontPropertiesTests.swift +++ b/Tests/MarkdownUITests/FontPropertiesTests.swift @@ -20,7 +20,7 @@ // then XCTAssertEqual( - Font.custom("Menlo", size: FontProperties.defaultSize), + Font.custom("Menlo", fixedSize: FontProperties.defaultSize), Font.withProperties(fontProperties) )