Skip to content

Commit

Permalink
Fix custom font dynamic size (#330)
Browse files Browse the repository at this point in the history
* Calling `fixedSize` constructor for dynamic type

* Fix tests

---------

Co-authored-by: Mike Lewis <ml@anthropic.com>
  • Loading branch information
gonzalezreal and mikelikespie authored Jun 16, 2024
1 parent 9f6c50f commit 9a8119b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Tests/MarkdownUITests/FontPropertiesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// then
XCTAssertEqual(
Font.custom("Menlo", size: FontProperties.defaultSize),
Font.custom("Menlo", fixedSize: FontProperties.defaultSize),
Font.withProperties(fontProperties)
)

Expand Down

0 comments on commit 9a8119b

Please sign in to comment.