From cf2f09040be6893606e87d15850bd9d6ef3a2ef6 Mon Sep 17 00:00:00 2001 From: Louis Sobel Date: Thu, 15 Oct 2026 11:49:26 -0400 Subject: [PATCH] monospace digits --- README.md | 2 +- UTCMenuClock/UTCMenuClockAppDelegate.m | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d30397e..918fac3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ teams, distributed work, aviation, astronomy, or anyone who needs a reliable UTC reference next to the system clock. ## Features -- UTC clock in the menu bar using the system menu bar font (`menuBarFontOfSize`, 14pt) to match the macOS clock. +- UTC clock in the menu bar using the system menu bar font (`menuBarFontOfSize`, 14pt) with monospaced digits, matching the macOS clock. - Toggle 24-hour/12-hour display, seconds, date, Julian day, and timezone suffix. - ISO-8601 override for the menubar text plus “Copy as ISO-8601.” - Copy the current UTC timestamp (using your selected format) to the clipboard. diff --git a/UTCMenuClock/UTCMenuClockAppDelegate.m b/UTCMenuClock/UTCMenuClockAppDelegate.m index e3729db..9d77b93 100644 --- a/UTCMenuClock/UTCMenuClockAppDelegate.m +++ b/UTCMenuClock/UTCMenuClockAppDelegate.m @@ -110,8 +110,10 @@ - (void)openGithubURL:(id)sender { - (NSDictionary *)statusBarTitleAttributes { // Menu bar items use menuBarFont (14pt), not systemFontSize (13pt). + // Use monospaced digits so the title doesn't jitter as the seconds tick. + CGFloat size = [NSFont menuBarFontOfSize:0].pointSize; return @{ - NSFontAttributeName: [NSFont menuBarFontOfSize:0], + NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:size weight:NSFontWeightRegular], NSForegroundColorAttributeName: NSColor.labelColor, }; }