Add font infrastructure

This commit is contained in:
Guille Gonzalez
2025-12-31 17:22:20 +01:00
parent 5e8e93b53e
commit fbfc1d0ecf
9 changed files with 674 additions and 4 deletions

View File

@@ -0,0 +1,35 @@
import Foundation
extension Math {
public struct Font: Hashable, Sendable {
public struct Name: Hashable, Sendable, RawRepresentable, ExpressibleByStringLiteral {
public let rawValue: String
public init(rawValue: String) {
self.rawValue = rawValue
}
public init(stringLiteral value: StringLiteralType) {
self.rawValue = value
}
}
public let name: Name
public let size: CGFloat
}
}
extension Math.Font.Name {
public static let latinModern: Self = "latinmodern-math"
public static let kpMathLight: Self = "KpMath-Light"
public static let kpMathSans: Self = "KpMath-Sans"
public static let xits: Self = "xits-math"
public static let termes: Self = "texgyretermes-math"
public static let asana: Self = "Asana-Math"
public static let euler: Self = "Euler-Math"
public static let fira: Self = "FiraMath-Regular"
public static let notoSans: Self = "NotoSansMath-Regular"
public static let libertinus: Self = "LibertinusMath-Regular"
public static let garamond: Self = "Garamond-Math"
public static let leteSans: Self = "LeteSansMath"
}