feat: support for monospace system font
Provides support for the `monospacedSystemFontOfSize` method from `NSFont`. Refer: https://developer.apple.com/documentation/appkit/nsfont/3042659-monospacedsystemfontofsize?language=objc
This commit is contained in:
parent
1ad51887a4
commit
d5f8b0d6e5
|
@ -40,6 +40,14 @@ impl Font {
|
|||
|
||||
Font(unsafe { ShareId::from_ptr(msg_send![class!(NSFont), boldSystemFontOfSize: size]) })
|
||||
}
|
||||
|
||||
/// Creates and returns a monospace system font at the specified size and weight
|
||||
pub fn monospace(size: f64, weight: f64) -> Self {
|
||||
let size = size as CGFloat;
|
||||
let weight = weight as CGFloat;
|
||||
|
||||
Font(unsafe { ShareId::from_ptr(msg_send![class!(NSFont), monospacedSystemFontOfSize: size weight: weight]) })
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for Font {
|
||||
|
|
Loading…
Reference in a new issue