Implement Math view

This commit is contained in:
Guille Gonzalez
2026-01-04 15:33:48 +01:00
parent 6e1a38ede7
commit baea9de415
9 changed files with 356 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import Foundation
import SwiftUI
extension Math {
public struct Font: Hashable, Sendable {
@@ -33,3 +33,13 @@ extension Math.Font.Name {
public static let garamond: Self = "Garamond-Math"
public static let leteSans: Self = "LeteSansMath"
}
extension View {
public func mathFont(_ font: Math.Font) -> some View {
environment(\.mathFont, font)
}
}
extension EnvironmentValues {
@Entry var mathFont = Math.Font(name: .latinModern, size: 20)
}