From fb56c11a296cb0258aea6a5998162913c2d8765e Mon Sep 17 00:00:00 2001 From: jay Date: Sat, 16 May 2026 04:04:48 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20default=20font=20size=2013pt=20=E2=86=92?= =?UTF-8?q?=2011pt=20for=20~53=20cols=20on=20iPhone=2012=20mini?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/UI/Terminal/FontStore.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/UI/Terminal/FontStore.swift b/Sources/UI/Terminal/FontStore.swift index 172e555..3d21ffd 100644 --- a/Sources/UI/Terminal/FontStore.swift +++ b/Sources/UI/Terminal/FontStore.swift @@ -8,7 +8,7 @@ import Combine private let kFontIdKey = "terminal.font" private let kFontSizeKey = "terminal.fontSize" -private let kDefaultSize: CGFloat = 13 +private let kDefaultSize: CGFloat = 11 @MainActor public final class FontStore: ObservableObject { @@ -30,8 +30,11 @@ public final class FontStore: ObservableObject { private init() { // Restore point size (clamped to a sane range). + // If stored value is the old default (13pt), migrate to new default (11pt). let storedSize = UserDefaults.standard.object(forKey: kFontSizeKey) as? CGFloat - size = storedSize.map { max(8, min(32, $0)) } ?? kDefaultSize + if storedSize == 13 { UserDefaults.standard.removeObject(forKey: kFontSizeKey) } + let effectiveStored = storedSize == 13 ? nil : storedSize + size = effectiveStored.map { max(8, min(32, $0)) } ?? kDefaultSize // Restore selected font id. let all: [TerminalFont] = [.sfMono, .menlo, .jetBrainsMono]