From 75a7416b7e55b0fe7aedfbb63ee2d1576abca18f Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Mon, 10 Jun 2024 21:20:53 +0200 Subject: [PATCH] fix: fixed crash when calculating text width for a monospaced font (#1988) --- Kit/Widgets/Stack.swift | 2 +- Stats.xcodeproj/project.pbxproj | 4 ++-- Stats/Supporting Files/Info.plist | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Kit/Widgets/Stack.swift b/Kit/Widgets/Stack.swift index 0209c72b..d4480f59 100644 --- a/Kit/Widgets/Stack.swift +++ b/Kit/Widgets/Stack.swift @@ -136,7 +136,7 @@ public class StackWidget: WidgetWrapper { private func drawOneRow(_ x: CGFloat, _ element: Stack_t) -> CGFloat { var font: NSFont = NSFont.systemFont(ofSize: 13, weight: .regular) if self.monospacedFontState { - font = NSFont.monospacedSystemFont(ofSize: 13, weight: .regular) + font = NSFont.monospacedDigitSystemFont(ofSize: 13, weight: .regular) } let style = NSMutableParagraphStyle() diff --git a/Stats.xcodeproj/project.pbxproj b/Stats.xcodeproj/project.pbxproj index 82b77e8e..34c4550a 100644 --- a/Stats.xcodeproj/project.pbxproj +++ b/Stats.xcodeproj/project.pbxproj @@ -2522,7 +2522,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 2.10.16; + MARKETING_VERSION = 2.10.17; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2560,7 +2560,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 2.10.16; + MARKETING_VERSION = 2.10.17; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Stats/Supporting Files/Info.plist b/Stats/Supporting Files/Info.plist index b877913e..b727ef0f 100755 --- a/Stats/Supporting Files/Info.plist +++ b/Stats/Supporting Files/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 568 + 569 Description Simple macOS system monitor in your menu bar LSApplicationCategoryType