Play Time Field: Changed how control achieves monospace numbers, and changed font

This commit is contained in:
Christopher Snowhill 2022-01-20 22:03:59 -08:00
parent 0f90dd3b3e
commit 71347aab83

View file

@ -22,12 +22,21 @@ NSString * formatTimer(long minutes, long seconds, unichar prefix) {
- (void)awakeFromNib - (void)awakeFromNib
{ {
showTimeRemaining = [[NSUserDefaults standardUserDefaults] boolForKey:kTimerModeKey]; showTimeRemaining = [[NSUserDefaults standardUserDefaults] boolForKey:kTimerModeKey];
if (@available(macOS 10.15, *)) {
fontAttributes = NSFontDescriptor * fontDesc = [[NSFont systemFontOfSize:13] fontDescriptor];
@{NSFontAttributeName : [NSFont monospacedSystemFontOfSize:13
weight:NSFontWeightMedium]}; NSDictionary *fontFeatureSettings = @{NSFontFeatureTypeIdentifierKey: @(kNumberSpacingType),
[self update]; NSFontFeatureSelectorIdentifierKey: @(kMonospacedNumbersSelector)
} };
NSDictionary *fontFeatureAttributes = @{NSFontFeatureSettingsAttribute: @[ fontFeatureSettings ] };
fontDesc = [fontDesc fontDescriptorByAddingAttributes:fontFeatureAttributes];
NSFont * font = [NSFont fontWithDescriptor:fontDesc size:13];
fontAttributes =
@{NSFontAttributeName : font};
} }
- (void)update - (void)update