Permalink
Browse files

(minor) Some reformatting.

  • Loading branch information...
1 parent c027e60 commit 4f093de379970c578c9d42e2db94b0572a7a31c3 @ELLIOTTCABLE committed Jun 11, 2010
Showing with 11 additions and 16 deletions.
  1. +11 −16 YRSolcounter.m
View
@@ -38,14 +38,11 @@ -(id) initWithBundle: (NSBundle*)bundle {
ofType: @"otf"
inDirectory: @"Fonts"]];
- // Core Foundation pain
- radixFont = (NSFont*)CTFontCreateWithFontDescriptor((CTFontDescriptorRef)[[(NSArray*)CTFontManagerCreateFontDescriptorsFromURL((CFURLRef)fontURL) autorelease] objectAtIndex:0], 18., NULL);
- // end Core Foundation pain
-
- NSLog(@"radixFont: %@", radixFont);
+ radixFont = (NSFont*)CTFontCreateWithFontDescriptor(
+ (CTFontDescriptorRef)[[(NSArray*)CTFontManagerCreateFontDescriptorsFromURL((CFURLRef)fontURL) autorelease]
+ lastObject], 18.0, NULL);
[self handleTimer: nil];
-
[nib dealloc];
return self;
}
@@ -60,13 +57,12 @@ -(void) handleTimer: (NSTimer*)_ {
(unsigned long long int)(date / 0.0864) % 1000,
(unsigned long long int)(date / 0.0000864) % 1000];
- NSDictionary *solCountAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSFont menuFontOfSize: 14.0], NSFontAttributeName,
- [[NSColor blackColor] colorWithAlphaComponent: .9], NSForegroundColorAttributeName,
- nil];
- NSMutableAttributedString *attributedSolCount = //»
- [[NSMutableAttributedString alloc] initWithString: solCount
- attributes: solCountAttributes];
+ NSMutableAttributedString *attributedSolCount = [[[NSMutableAttributedString alloc]
+ initWithString: solCount
+ attributes: [[[NSDictionary alloc] initWithObjectsAndKeys:
+ [NSFont menuFontOfSize: 14.0], NSFontAttributeName,
+ [[NSColor blackColor] colorWithAlphaComponent: 1.0], NSForegroundColorAttributeName,
+ nil] autorelease]] autorelease];
int length = [solCount length];
NSRange nanosolRange = NSMakeRange(length - (1 * 4), 4);
@@ -76,20 +72,19 @@ -(void) handleTimer: (NSTimer*)_ {
NSRange solRange = NSMakeRange(length - (4 * 4) - 1, 4);
NSRange kilosolRange = NSMakeRange(0, 3);
+ [attributedSolCount addAttribute: NSFontAttributeName value: radixFont range: radixRange];
+
[attributedSolCount addAttribute: NSForegroundColorAttributeName
value: [[NSColor blackColor] colorWithAlphaComponent:.3]
range: nanosolRange];
[attributedSolCount addAttribute: NSForegroundColorAttributeName
value: [[NSColor blackColor] colorWithAlphaComponent:.3]
range: microsolRange];
- [attributedSolCount addAttribute: NSFontAttributeName value: radixFont range: radixRange];
[attributedSolCount addAttribute: NSForegroundColorAttributeName
value: [[NSColor blackColor] colorWithAlphaComponent:.3]
range: kilosolRange];
[textField setAttributedStringValue: attributedSolCount];
- [attributedSolCount release];
- [solCountAttributes release];
}
-(void) dealloc

0 comments on commit 4f093de

Please sign in to comment.