corrected some variable names within BundleManager functions, added onDemandBundle registration instead of loading all Resources at startup.

This commit is contained in:
Peter Tang
2023-09-15 17:06:06 +08:00
parent 2cdab9cc0e
commit 40a6896889
2 changed files with 28 additions and 8 deletions

View File

@@ -37,6 +37,13 @@ final class MathFontTests: XCTestCase {
}
#endif
}
func testOnDemandMathFontScript() throws {
let size = Int.random(in: 20 ... 40)
let mathFont = MathFont.allCases.randomElement()!
XCTAssertNotNil(mathFont.cgFont())
XCTAssertNotNil(mathFont.ctFont(withSize: CGFloat(size)))
XCTAssertEqual(mathFont.ctFont(withSize: CGFloat(size)).fontSize, CGFloat(size), "ctFont fontSize test")
}
var fontNames: [String] {
MathFont.allCases.map { $0.fontName }
}