native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #171 from supabitapp/sync-ghostty-ui-font

Sync UI monospaced font with Ghostty

authored by

khoi and committed by
GitHub
5b8a8a9b e7112de7

+270 -56
+1 -1
supacode/App/AppLoadingView.swift
··· 31 31 VStack { 32 32 Text(Self.messages[messageIndex]) 33 33 .font(.title3) 34 + .ghosttyMonospaced(.title3) 34 35 .bold() 35 - .monospaced() 36 36 ProgressView() 37 37 .controlSize(.large) 38 38 }
+6
supacode/App/supacodeApp.swift
··· 31 31 struct SupacodeApp: App { 32 32 @State private var ghostty: GhosttyRuntime 33 33 @State private var ghosttyShortcuts: GhosttyShortcutManager 34 + @State private var ghosttyFonts: GhosttyFontManager 34 35 @State private var terminalManager: WorktreeTerminalManager 35 36 @State private var worktreeInfoWatcher: WorktreeInfoWatcherManager 36 37 @State private var commandKeyObserver: CommandKeyObserver ··· 64 65 _ghostty = State(initialValue: runtime) 65 66 let shortcuts = GhosttyShortcutManager(runtime: runtime) 66 67 _ghosttyShortcuts = State(initialValue: shortcuts) 68 + let fonts = GhosttyFontManager(runtime: runtime) 69 + _ghosttyFonts = State(initialValue: fonts) 67 70 let initialSettings = GlobalSettings.default 68 71 let terminalManager = WorktreeTerminalManager(runtime: runtime) 69 72 _terminalManager = State(initialValue: terminalManager) ··· 98 101 SettingsWindowManager.shared.configure( 99 102 store: appStore, 100 103 ghosttyShortcuts: shortcuts, 104 + ghosttyFonts: fonts, 101 105 commandKeyObserver: keyObserver 102 106 ) 103 107 } ··· 107 111 GhosttyColorSchemeSyncView(ghostty: ghostty) { 108 112 ContentView(store: store, terminalManager: terminalManager) 109 113 .environment(ghosttyShortcuts) 114 + .environment(ghosttyFonts) 110 115 .environment(commandKeyObserver) 111 116 } 112 117 .preferredColorScheme(store.settings.appearanceMode.colorScheme) 113 118 } 114 119 .environment(ghosttyShortcuts) 120 + .environment(ghosttyFonts) 115 121 .environment(commandKeyObserver) 116 122 .commands { 117 123 WorktreeCommands(store: store)
+3 -3
supacode/Features/Repositories/Views/FailedRepositoryRow.swift
··· 14 14 .fill(.secondary.opacity(0.2)) 15 15 Text(initials) 16 16 .font(.caption) 17 - .monospaced() 17 + .ghosttyMonospaced(.caption) 18 18 .foregroundStyle(.secondary) 19 19 } 20 20 .frame(width: 24, height: 24) ··· 22 22 VStack(alignment: .leading, spacing: 2) { 23 23 Text(name) 24 24 .font(.headline) 25 - .monospaced() 25 + .ghosttyMonospaced(.headline) 26 26 Text(path) 27 27 .font(.caption) 28 - .monospaced() 28 + .ghosttyMonospaced(.caption) 29 29 .foregroundStyle(.secondary) 30 30 } 31 31 Spacer(minLength: 8)
+3
supacode/Features/Repositories/Views/OpenWorktreeActionMenuLabelView.swift
··· 28 28 if let shortcutHint { 29 29 HStack(spacing: 2) { 30 30 Text(action.labelTitle) 31 + .ghosttyMonospaced(.body) 31 32 Text("(\(shortcutHint))") 33 + .ghosttyMonospaced(.body) 32 34 .foregroundStyle(.secondary) 33 35 } 34 36 } else { 35 37 Text(action.labelTitle) 38 + .ghosttyMonospaced(.body) 36 39 } 37 40 } 38 41 }
+1 -1
supacode/Features/Repositories/Views/PullRequestBadgeView.swift
··· 38 38 var body: some View { 39 39 Text(text) 40 40 .font(.caption2) 41 - .monospaced() 41 + .ghosttyMonospaced(.caption2) 42 42 .foregroundStyle(color) 43 43 .padding(.horizontal, 6) 44 44 .padding(.vertical, 2)
+1 -1
supacode/Features/Repositories/Views/PullRequestStatusButton.swift
··· 31 31 } 32 32 } 33 33 .font(.caption) 34 - .monospaced() 34 + .ghosttyMonospaced(.caption) 35 35 } 36 36 37 37 }
+4 -4
supacode/Features/Repositories/Views/RepoHeaderRow.swift
··· 10 10 HStack { 11 11 Image(systemName: "chevron.right") 12 12 .font(.caption) 13 - .monospaced() 13 + .ghosttyMonospaced(.caption) 14 14 .foregroundStyle(.secondary) 15 15 .accessibilityHidden(true) 16 16 .rotationEffect(.degrees(isExpanded ? 90 : 0)) ··· 21 21 .fill(.secondary.opacity(0.2)) 22 22 Text(initials) 23 23 .font(.caption) 24 - .monospaced() 24 + .ghosttyMonospaced(.caption) 25 25 .foregroundStyle(.secondary) 26 26 } 27 27 .frame(width: 24, height: 24) 28 28 .clipShape(.rect(cornerRadius: 6, style: .continuous)) 29 29 Text(name) 30 30 .font(.headline) 31 - .monospaced() 31 + .ghosttyMonospaced(.headline) 32 32 .foregroundStyle(.primary) 33 33 if isRemoving { 34 34 Text("Removing...") 35 35 .font(.caption) 36 - .monospaced() 36 + .ghosttyMonospaced(.caption) 37 37 .foregroundStyle(.secondary) 38 38 } 39 39 }
+1
supacode/Features/Repositories/Views/SidebarFooterView.swift
··· 13 13 } label: { 14 14 HStack(spacing: 6) { 15 15 Label("Add Repository", systemImage: "folder.badge.plus") 16 + .ghosttyMonospaced(.callout) 16 17 if commandKeyObserver.isPressed { 17 18 ShortcutHintView(text: AppShortcuts.openRepository.display, color: .secondary) 18 19 }
+1 -1
supacode/Features/Repositories/Views/WorktreeDetailTitleView.swift
··· 19 19 Text(branchName) 20 20 } 21 21 .font(.headline) 22 - .monospaced() 22 + .ghosttyMonospaced(.headline) 23 23 } 24 24 .help("Rename branch") 25 25 .popover(isPresented: $isPresented) {
+3 -4
supacode/Features/Repositories/Views/WorktreeDetailView.swift
··· 240 240 } 241 241 } label: { 242 242 Image(systemName: "chevron.down") 243 - .font(.caption2) 244 - .monospaced() 243 + .ghosttyMonospaced(.caption2) 245 244 .accessibilityLabel("Open in menu") 246 245 } 247 246 .imageScale(.small) ··· 329 328 330 329 if commandKeyObserver.isPressed { 331 330 Text(config.shortcut) 332 - .monospaced() 331 + .ghosttyMonospaced(.caption) 333 332 .foregroundStyle(.secondary) 334 333 } 335 334 } 336 335 } 337 336 .font(.caption) 338 - .monospaced() 337 + .ghosttyMonospaced(.caption) 339 338 .help(config.helpText) 340 339 .disabled(!config.isEnabled) 341 340 }
+4 -4
supacode/Features/Repositories/Views/WorktreeLoadingView.swift
··· 13 13 ProgressView() 14 14 Text(info.name) 15 15 .font(.headline) 16 - .monospaced() 16 + .ghosttyMonospaced(.headline) 17 17 if let repositoryName = info.repositoryName { 18 18 Text("\(actionLabel) worktree in \(repositoryName)") 19 19 .font(.subheadline) 20 - .monospaced() 20 + .ghosttyMonospaced(.subheadline) 21 21 .foregroundStyle(.secondary) 22 22 } else { 23 23 Text("\(actionLabel) worktree...") 24 24 .font(.subheadline) 25 - .monospaced() 25 + .ghosttyMonospaced(.subheadline) 26 26 .foregroundStyle(.secondary) 27 27 } 28 28 Text(followup) 29 29 .font(.subheadline) 30 - .monospaced() 30 + .ghosttyMonospaced(.subheadline) 31 31 .foregroundStyle(.secondary) 32 32 } 33 33 .frame(maxWidth: .infinity, maxHeight: .infinity)
+6 -6
supacode/Features/Repositories/Views/WorktreeRow.swift
··· 39 39 if showsNotificationIndicator { 40 40 Image(systemName: "bell.fill") 41 41 .font(.caption) 42 - .monospaced() 42 + .ghosttyMonospaced(.caption) 43 43 .foregroundStyle(.orange) 44 44 .opacity(showsSpinner ? 0 : 1) 45 45 .help("Unread notifications") ··· 47 47 } else { 48 48 Image(systemName: branchIconName) 49 49 .font(.caption) 50 - .monospaced() 50 + .ghosttyMonospaced(.caption) 51 51 .foregroundStyle(.secondary) 52 52 .opacity(showsSpinner ? 0 : 1) 53 53 .accessibilityHidden(true) ··· 61 61 if hasInfo { 62 62 VStack(alignment: .leading, spacing: 2) { 63 63 Text(name) 64 - .monospaced() 64 + .ghosttyMonospaced(.body) 65 65 WorktreeRowInfoView(addedLines: displayAddedLines, removedLines: displayRemovedLines) 66 66 } 67 67 } else { 68 68 Text(name) 69 - .monospaced() 69 + .ghosttyMonospaced(.body) 70 70 } 71 71 Spacer(minLength: 8) 72 72 if isRunScriptRunning { 73 73 Image(systemName: "play.fill") 74 74 .font(.caption) 75 - .monospaced() 75 + .ghosttyMonospaced(.caption) 76 76 .foregroundStyle(.green) 77 77 .help("Run script active") 78 78 .accessibilityLabel("Run script active") ··· 118 118 } 119 119 } 120 120 .font(.caption) 121 - .monospaced() 121 + .ghosttyMonospaced(.caption) 122 122 .frame(minHeight: 14) 123 123 } 124 124 }
+6 -12
supacode/Features/Repositories/Views/XcodeStyleToolbarViews.swift
··· 247 247 HStack(spacing: 8) { 248 248 Image(systemName: style.icon) 249 249 .foregroundStyle(style.color) 250 - .font(.callout) 251 - .monospaced() 250 + .ghosttyMonospaced(.callout) 252 251 .accessibilityHidden(true) 253 252 254 253 Text(Self.message(for: context.date)) 255 - .font(.footnote) 256 - .monospaced() 254 + .ghosttyMonospaced(.footnote) 257 255 .foregroundStyle(.secondary) 258 256 } 259 257 } ··· 266 264 HStack(spacing: 5) { 267 265 Image(systemName: "exclamationmark.triangle.fill") 268 266 .foregroundStyle(.yellow) 269 - .font(.footnote) 270 - .monospaced() 267 + .ghosttyMonospaced(.footnote) 271 268 .accessibilityHidden(true) 272 269 Text("3") 273 - .font(.footnote.weight(.medium)) 274 - .monospaced() 270 + .ghosttyMonospaced(.footnote, weight: .medium) 275 271 } 276 272 .padding(.horizontal, 8) 277 273 .padding(.vertical, 4) ··· 280 276 HStack(spacing: 5) { 281 277 Image(systemName: "xmark.circle.fill") 282 278 .foregroundStyle(.red) 283 - .font(.footnote) 284 - .monospaced() 279 + .ghosttyMonospaced(.footnote) 285 280 .accessibilityHidden(true) 286 281 Text("0") 287 - .font(.footnote.weight(.medium)) 288 - .monospaced() 282 + .ghosttyMonospaced(.footnote, weight: .medium) 289 283 } 290 284 .padding(.horizontal, 8) 291 285 .padding(.vertical, 4)
+7 -1
supacode/Features/Settings/BusinessLogic/SettingsWindowManager.swift
··· 9 9 private var settingsWindow: NSWindow? 10 10 private var store: StoreOf<AppFeature>? 11 11 private var ghosttyShortcuts: GhosttyShortcutManager? 12 + private var ghosttyFonts: GhosttyFontManager? 12 13 private var commandKeyObserver: CommandKeyObserver? 13 14 14 15 private init() {} ··· 16 17 func configure( 17 18 store: StoreOf<AppFeature>, 18 19 ghosttyShortcuts: GhosttyShortcutManager, 20 + ghosttyFonts: GhosttyFontManager, 19 21 commandKeyObserver: CommandKeyObserver 20 22 ) { 21 23 self.store = store 22 24 self.ghosttyShortcuts = ghosttyShortcuts 25 + self.ghosttyFonts = ghosttyFonts 23 26 self.commandKeyObserver = commandKeyObserver 24 27 } 25 28 ··· 32 35 return 33 36 } 34 37 35 - guard let store, let ghosttyShortcuts, let commandKeyObserver else { return } 38 + guard let store, let ghosttyShortcuts, let ghosttyFonts, let commandKeyObserver else { 39 + return 40 + } 36 41 let settingsView = SettingsView(store: store) 37 42 .environment(ghosttyShortcuts) 43 + .environment(ghosttyFonts) 38 44 .environment(commandKeyObserver) 39 45 let hostingController = NSHostingController(rootView: settingsView) 40 46
+1 -1
supacode/Features/Settings/Views/AppearanceOptionCardView.swift
··· 40 40 .aspectRatio(1.6, contentMode: .fit) 41 41 Text(mode.title) 42 42 .font(.headline) 43 - .monospaced() 43 + .ghosttyMonospaced(.headline) 44 44 } 45 45 .frame(maxWidth: .infinity) 46 46 .padding()
+2 -2
supacode/Features/Settings/Views/GithubSettingsView.swift
··· 84 84 case .authenticated(let username, let host): 85 85 LabeledContent("Signed in as") { 86 86 Text(username) 87 - .monospaced() 87 + .ghosttyMonospaced(.body) 88 88 } 89 89 LabeledContent("Host") { 90 90 Text(host) 91 - .monospaced() 91 + .ghosttyMonospaced(.body) 92 92 } 93 93 94 94 case .error(let message):
+4 -4
supacode/Features/Settings/Views/RepositorySettingsView.swift
··· 62 62 text: settings.setupScript 63 63 ) 64 64 .font(.body) 65 - .monospaced() 65 + .ghosttyMonospaced(.body) 66 66 .frame(minHeight: 120) 67 67 if store.settings.setupScript.isEmpty { 68 68 Text("claude --dangerously-skip-permissions") 69 69 .foregroundStyle(.secondary) 70 70 .padding(.leading, 6) 71 71 .font(.body) 72 - .monospaced() 72 + .ghosttyMonospaced(.body) 73 73 .allowsHitTesting(false) 74 74 } 75 75 } ··· 86 86 text: settings.runScript 87 87 ) 88 88 .font(.body) 89 - .monospaced() 89 + .ghosttyMonospaced(.body) 90 90 .frame(minHeight: 120) 91 91 if store.settings.runScript.isEmpty { 92 92 Text("npm run dev") 93 93 .foregroundStyle(.secondary) 94 94 .padding(.leading, 6) 95 95 .font(.body) 96 - .monospaced() 96 + .ghosttyMonospaced(.body) 97 97 .allowsHitTesting(false) 98 98 } 99 99 }
+1 -2
supacode/Features/Terminal/TabBar/Views/TerminalTabCloseButton.swift
··· 20 20 } 21 21 .labelStyle(.iconOnly) 22 22 .buttonStyle(TerminalPressTrackingButtonStyle(isPressed: $isPressing)) 23 - .font(.caption2) 24 - .monospaced() 23 + .ghosttyMonospaced(.caption2) 25 24 .bold() 26 25 .foregroundStyle( 27 26 isHoveringClose ? TerminalTabBarColors.activeText : TerminalTabBarColors.inactiveText
+2 -2
supacode/Features/Terminal/Views/EmptyTerminalPaneView.swift
··· 7 7 VStack { 8 8 Text(message) 9 9 .font(.headline) 10 - .monospaced() 10 + .ghosttyMonospaced(.headline) 11 11 Text("Use the plus button to open a terminal.") 12 12 .font(.subheadline) 13 - .monospaced() 13 + .ghosttyMonospaced(.subheadline) 14 14 .foregroundStyle(.secondary) 15 15 } 16 16 .frame(maxWidth: .infinity, maxHeight: .infinity)
+4 -3
supacode/Features/Terminal/Views/GhosttySurfaceSearchOverlay.swift
··· 130 130 let totalLabel = state.searchTotal.map(String.init) ?? "?" 131 131 Text("\(selected + 1)/\(totalLabel)") 132 132 .font(.caption) 133 - .monospaced() 133 + .ghosttyMonospaced(.caption) 134 134 .foregroundStyle(.secondary) 135 135 .padding(.trailing, 8) 136 136 } else if let total = state.searchTotal { 137 137 Text("-/\(total)") 138 138 .font(.caption) 139 - .monospaced() 139 + .ghosttyMonospaced(.caption) 140 140 .foregroundStyle(.secondary) 141 141 .padding(.trailing, 8) 142 142 } ··· 265 265 var isFocused: Bool 266 266 var onSubmit: (Bool) -> Void 267 267 var onEscape: () -> Void 268 + @Environment(GhosttyFontManager.self) private var ghosttyFonts 268 269 269 270 func makeCoordinator() -> Coordinator { 270 271 Coordinator(text: $text) ··· 290 291 } 291 292 nsView.onSubmit = onSubmit 292 293 nsView.onEscape = onEscape 293 - nsView.font = NSFont.monospacedSystemFont(ofSize: NSFont.systemFontSize, weight: .regular) 294 + nsView.font = ghosttyFonts.nsFont(size: NSFont.systemFontSize, weight: .regular) 294 295 295 296 if isFocused, nsView.window?.firstResponder !== nsView.currentEditor() { 296 297 nsView.window?.makeFirstResponder(nsView)
+1 -2
supacode/Features/Terminal/Views/TerminalSplitTreeView.swift
··· 133 133 .overlay { 134 134 if isHovering { 135 135 Image(systemName: "ellipsis") 136 - .font(.callout.weight(.semibold)) 137 - .monospaced() 136 + .ghosttyMonospaced(.callout, weight: .semibold) 138 137 .foregroundStyle(.primary.opacity(0.5)) 139 138 .accessibilityHidden(true) 140 139 }
+1 -1
supacode/Features/Terminal/Views/WorktreeNotificationsListView.swift
··· 9 9 VStack(alignment: .leading) { 10 10 Text("Notifications") 11 11 .font(.headline) 12 - .monospaced() 12 + .ghosttyMonospaced(.headline) 13 13 ForEach(state.notifications) { notification in 14 14 Button { 15 15 _ = state.focusSurface(id: notification.surfaceId)
+160
supacode/Infrastructure/Ghostty/GhosttyFontManager.swift
··· 1 + import AppKit 2 + import Observation 3 + import SwiftUI 4 + 5 + @MainActor 6 + @Observable 7 + final class GhosttyFontManager { 8 + private let runtime: GhosttyRuntime 9 + private var observer: NSObjectProtocol? 10 + private var familyName: String? 11 + 12 + init(runtime: GhosttyRuntime) { 13 + self.runtime = runtime 14 + refresh() 15 + observer = NotificationCenter.default.addObserver( 16 + forName: .ghosttyRuntimeConfigDidChange, 17 + object: nil, 18 + queue: .main 19 + ) { [weak self] _ in 20 + Task { @MainActor in 21 + self?.refresh() 22 + } 23 + } 24 + } 25 + 26 + @MainActor deinit { 27 + if let observer { 28 + NotificationCenter.default.removeObserver(observer) 29 + } 30 + } 31 + 32 + func font(for style: Font.TextStyle, weight: Font.Weight? = nil) -> Font { 33 + if let familyName { 34 + let base = Font.custom(familyName, size: preferredSize(for: style), relativeTo: style) 35 + return base.weight(weight ?? preferredWeight(for: style)) 36 + } 37 + if let weight { 38 + return .system(style, design: .monospaced).weight(weight) 39 + } 40 + return .system(style, design: .monospaced) 41 + } 42 + 43 + func font(size: CGFloat, weight: Font.Weight? = nil) -> Font { 44 + if familyName != nil { 45 + let nsWeight = weight.map(nsWeight(for:)) ?? .regular 46 + return Font(nsFont(size: size, weight: nsWeight)) 47 + } 48 + let resolvedWeight = weight ?? .regular 49 + return .system(size: size, weight: resolvedWeight, design: .monospaced) 50 + } 51 + 52 + func nsFont(size: CGFloat, weight: NSFont.Weight) -> NSFont { 53 + guard let familyName else { 54 + return NSFont.monospacedSystemFont(ofSize: size, weight: weight) 55 + } 56 + let descriptor = NSFontDescriptor(fontAttributes: [ 57 + .family: familyName, 58 + .traits: [NSFontDescriptor.TraitKey.weight: weight.rawValue], 59 + ]) 60 + if let font = NSFont(descriptor: descriptor, size: size) { 61 + return font 62 + } 63 + if let font = NSFont(name: familyName, size: size) { 64 + return font 65 + } 66 + return NSFont.monospacedSystemFont(ofSize: size, weight: weight) 67 + } 68 + 69 + private func refresh() { 70 + familyName = runtime.primaryFontFamilyName() 71 + } 72 + 73 + private func preferredSize(for style: Font.TextStyle) -> CGFloat { 74 + NSFont.preferredFont(forTextStyle: nsTextStyle(for: style)).pointSize 75 + } 76 + 77 + private func preferredWeight(for style: Font.TextStyle) -> Font.Weight { 78 + let font = NSFont.preferredFont(forTextStyle: nsTextStyle(for: style)) 79 + let traits = font.fontDescriptor.object(forKey: .traits) as? [NSFontDescriptor.TraitKey: Any] 80 + let weight = traits?[.weight] as? CGFloat ?? NSFont.Weight.regular.rawValue 81 + return fontWeight(for: NSFont.Weight(weight)) 82 + } 83 + 84 + private func fontWeight(for weight: NSFont.Weight) -> Font.Weight { 85 + switch weight.rawValue { 86 + case ..<(-0.7): 87 + return .ultraLight 88 + case ..<(-0.5): 89 + return .thin 90 + case ..<(-0.3): 91 + return .light 92 + case ..<(0.15): 93 + return .regular 94 + case ..<(0.28): 95 + return .medium 96 + case ..<(0.36): 97 + return .semibold 98 + case ..<(0.5): 99 + return .bold 100 + case ..<(0.7): 101 + return .heavy 102 + default: 103 + return .black 104 + } 105 + } 106 + 107 + private func nsWeight(for weight: Font.Weight) -> NSFont.Weight { 108 + switch weight { 109 + case .ultraLight: 110 + return .ultraLight 111 + case .thin: 112 + return .thin 113 + case .light: 114 + return .light 115 + case .regular: 116 + return .regular 117 + case .medium: 118 + return .medium 119 + case .semibold: 120 + return .semibold 121 + case .bold: 122 + return .bold 123 + case .heavy: 124 + return .heavy 125 + case .black: 126 + return .black 127 + default: 128 + return .regular 129 + } 130 + } 131 + 132 + private func nsTextStyle(for style: Font.TextStyle) -> NSFont.TextStyle { 133 + switch style { 134 + case .largeTitle: 135 + return .largeTitle 136 + case .title: 137 + return .title1 138 + case .title2: 139 + return .title2 140 + case .title3: 141 + return .title3 142 + case .headline: 143 + return .headline 144 + case .subheadline: 145 + return .subheadline 146 + case .body: 147 + return .body 148 + case .callout: 149 + return .callout 150 + case .footnote: 151 + return .footnote 152 + case .caption: 153 + return .caption1 154 + case .caption2: 155 + return .caption2 156 + @unknown default: 157 + return .body 158 + } 159 + } 160 + }
+15
supacode/Infrastructure/Ghostty/GhosttyRuntime.swift
··· 331 331 return Self.keyboardShortcut(for: trigger) 332 332 } 333 333 334 + func primaryFontFamilyName() -> String? { 335 + guard let config else { return Self.defaultFontFamilyName } 336 + var valuePtr: UnsafePointer<CChar>? 337 + let key = "font-family" 338 + if ghostty_config_get(config, &valuePtr, key, UInt(key.lengthOfBytes(using: .utf8))), 339 + let ptr = valuePtr 340 + { 341 + let value = String(cString: ptr) 342 + return value.isEmpty ? Self.defaultFontFamilyName : value 343 + } 344 + return Self.defaultFontFamilyName 345 + } 346 + 334 347 func shouldShowScrollbar() -> Bool { 335 348 guard let config else { return true } 336 349 var valuePtr: UnsafePointer<CChar>? ··· 400 413 GHOSTTY_KEY_BACKSPACE: .delete, 401 414 GHOSTTY_KEY_SPACE: .space, 402 415 ] 416 + 417 + private static let defaultFontFamilyName = "JetBrains Mono" 403 418 } 404 419 405 420 extension Notification.Name {
+31
supacode/Support/GhosttyMonospacedModifier.swift
··· 1 + import SwiftUI 2 + 3 + private struct GhosttyMonospacedStyleModifier: ViewModifier { 4 + @Environment(GhosttyFontManager.self) private var ghosttyFonts 5 + let style: Font.TextStyle 6 + let weight: Font.Weight? 7 + 8 + func body(content: Content) -> some View { 9 + content.font(ghosttyFonts.font(for: style, weight: weight)) 10 + } 11 + } 12 + 13 + private struct GhosttyMonospacedSizeModifier: ViewModifier { 14 + @Environment(GhosttyFontManager.self) private var ghosttyFonts 15 + let size: CGFloat 16 + let weight: Font.Weight? 17 + 18 + func body(content: Content) -> some View { 19 + content.font(ghosttyFonts.font(size: size, weight: weight)) 20 + } 21 + } 22 + 23 + extension View { 24 + func ghosttyMonospaced(_ style: Font.TextStyle, weight: Font.Weight? = nil) -> some View { 25 + modifier(GhosttyMonospacedStyleModifier(style: style, weight: weight)) 26 + } 27 + 28 + func ghosttyMonospaced(size: CGFloat, weight: Font.Weight? = nil) -> some View { 29 + modifier(GhosttyMonospacedSizeModifier(size: size, weight: weight)) 30 + } 31 + }
+1 -1
supacode/Support/ShortcutHintView.swift
··· 7 7 var body: some View { 8 8 Text(text) 9 9 .font(.caption2) 10 - .monospaced() 10 + .ghosttyMonospaced(.caption2) 11 11 .foregroundStyle(color) 12 12 } 13 13 }