|
1
|
1 //
|
|
|
2 // NSFont+pp.m
|
|
|
3 // foobar2000
|
|
|
4 //
|
|
|
5 // Created by Piotr Pawłowski on 30/06/2024.
|
|
|
6 // Copyright © 2024 Piotr Pawłowski. All rights reserved.
|
|
|
7 //
|
|
|
8
|
|
|
9 #import "NSFont+pp.h"
|
|
|
10
|
|
|
11 static NSFont * g_monospacedDigitFont;
|
|
|
12 static NSFont * g_monospacedFont;
|
|
|
13
|
|
|
14 @implementation NSFont (pp)
|
|
|
15 + (NSFont*) pp_monospacedDigitFont {
|
|
|
16 assert( NSThread.isMainThread );
|
|
|
17 if ( g_monospacedDigitFont == nil ) g_monospacedDigitFont = [NSFont monospacedDigitSystemFontOfSize: NSFont.systemFontSize weight: NSFontWeightRegular];
|
|
|
18 return g_monospacedDigitFont;
|
|
|
19 }
|
|
|
20 + (NSFont*) pp_monospacedFont {
|
|
|
21 assert( NSThread.isMainThread );
|
|
|
22 if ( g_monospacedFont == nil ) {
|
|
|
23 g_monospacedFont = [NSFont monospacedSystemFontOfSize: NSFont.systemFontSize weight: NSFontWeightRegular];
|
|
|
24 }
|
|
|
25 return g_monospacedFont;
|
|
|
26 }
|
|
|
27 @end
|