Implement Math view
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user