Skip to content

Commit 9a8119b

Browse files
Fix custom font dynamic size (#330)
* Calling `fixedSize` constructor for dynamic type * Fix tests --------- Co-authored-by: Mike Lewis <[email protected]>
1 parent 9f6c50f commit 9a8119b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/MarkdownUI/Theme/TextStyle/Styles/Font+FontProperties.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extension Font {
99
case .system(let design):
1010
font = .system(size: size, design: design)
1111
case .custom(let name):
12-
font = .custom(name, size: size)
12+
font = .custom(name, fixedSize: size)
1313
}
1414

1515
switch fontProperties.familyVariant {

Tests/MarkdownUITests/FontPropertiesTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
// then
2222
XCTAssertEqual(
23-
Font.custom("Menlo", size: FontProperties.defaultSize),
23+
Font.custom("Menlo", fixedSize: FontProperties.defaultSize),
2424
Font.withProperties(fontProperties)
2525
)
2626

0 commit comments

Comments
 (0)