macOS client panes and transcript

This commit is contained in:
Ian Gulliver
2026-10-16 23:30:57 -07:00
parent 14d7ad4631
commit 00cd1ed958
23 changed files with 5059 additions and 739 deletions
+14 -1
View File
@@ -24,7 +24,20 @@ enum Fonts {
return CTFontCreateWithFontDescriptor(d, size, nil)
}
nonisolated(unsafe) private static var fonts: [String: Font] = [:]
private static let lock = NSLock()
static func font(_ size: CGFloat, weight: CGFloat = 400, italic: Bool = false) -> Font {
Font(ct(size, weight: weight, italic: italic))
let key = "\(size) \(weight) \(italic)"
lock.lock()
defer {
lock.unlock()
}
if let f = fonts[key] {
return f
}
let f = Font(ct(size, weight: weight, italic: italic))
fonts[key] = f
return f
}
}