From 2f54ae59af8ce2c0f62dd776f2fede5d865d4519 Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Sun, 16 Oct 2022 22:20:40 -0300 Subject: [PATCH] fix: use `systemFontOfSize` as fallback for monospace --- src/text/font.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/text/font.rs b/src/text/font.rs index a38ff6f..d0151fe 100644 --- a/src/text/font.rs +++ b/src/text/font.rs @@ -51,13 +51,13 @@ impl Font { /// If the current system is using an older version the `monospacedSystemFontOfSize` /// option will be omitted. pub fn monospace(size: f64, weight: f64) -> Self { - if os::is_minimum_semversion(10, 15, 0) { - let size = size as CGFloat; - let weight = weight as CGFloat; + let size = size as CGFloat; + let weight = weight as CGFloat; + if os::is_minimum_semversion(10, 15, 0) { Font(unsafe { ShareId::from_ptr(msg_send![class!(NSFont), monospacedSystemFontOfSize: size weight: weight]) }) } else { - Font(unsafe { ShareId::from_ptr(msg_send![class!(NSFont), weight: weight]) }) + Font(unsafe { ShareId::from_ptr(msg_send![class!(NSFont), systemFontOfSize: size weight: weight ]) }) } } }