Mercurial > foo_out_sdl
comparison foosdk/sdk/foobar2000/helpers-mac/NSFont+pp.m @ 1:20d02a178406 default tip
*: check in everything else
yay
| author | Paper <paper@tflc.us> |
|---|---|
| date | Mon, 05 Jan 2026 02:15:46 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 0:e9bb126753e7 | 1:20d02a178406 |
|---|---|
| 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 |
