You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a Mac Catalyst app, the call to UIFont.fontNames(forFamilyName: "Font Awesome 5 Free") only returns one font even if more than one font is loaded. If two styles are used in an app, and the second one is used more than once the code will attempt to load the font again. The following unit test will fail (with an NSInternalConsistencyError tracing back to line 255 on FontAwesome.swift. the errors description reads "The file has already been registered in the specified scope". the regular style is used twice (at different sizes) and the code tries to load it twice.
This ONLY happens when running the tests in a Mac device (not in an iOS device) and is possibly due to a Mac Catalyst bug. It does mean however that Mac Catalyst applications will fail if they use more than one FontAwesome font.
func testFontsShouldBeLoadedIfFontUsedTwice(){letsolidFont=UIFont.fontAwesome(ofSize:200, style:.solid)letregularFont=UIFont.fontAwesome(ofSize:200, style:.regular)letregularFontSmaller=UIFont.fontAwesome(ofSize:100, style:.regular)XCTAssertNotNil(solidFont,"Solid font should be loaded.")XCTAssertNotNil(regularFont,"Regular font should be loaded.")XCTAssertNotNil(regularFontSmaller,"Smaller regular font should be loaded.")}
The unit test crashes on the 'let regularFontSmaller =' line
The text was updated successfully, but these errors were encountered:
In a Mac Catalyst app, the call to UIFont.fontNames(forFamilyName: "Font Awesome 5 Free") only returns one font even if more than one font is loaded. If two styles are used in an app, and the second one is used more than once the code will attempt to load the font again. The following unit test will fail (with an NSInternalConsistencyError tracing back to line 255 on FontAwesome.swift. the errors description reads "The file has already been registered in the specified scope". the regular style is used twice (at different sizes) and the code tries to load it twice.
This ONLY happens when running the tests in a Mac device (not in an iOS device) and is possibly due to a Mac Catalyst bug. It does mean however that Mac Catalyst applications will fail if they use more than one FontAwesome font.
The unit test crashes on the 'let regularFontSmaller =' line
The text was updated successfully, but these errors were encountered: