Skip to content

Commit

Permalink
Merge pull request Grouper#119 from dzenbot/master
Browse files Browse the repository at this point in the history
Added Lato-Light font to UIFont+FlatUI category class
  • Loading branch information
jflinter committed Apr 18, 2014
2 parents 8199615 + 3d2f6d4 commit b8a0489
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Classes/ios/UIFont+FlatUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
+ (UIFont *)flatFontOfSize:(CGFloat)size;
+ (UIFont *)boldFlatFontOfSize:(CGFloat)size;
+ (UIFont *)italicFlatFontOfSize:(CGFloat)size;
+ (UIFont *)lightFlatFontOfSize:(CGFloat)size;

@end
12 changes: 12 additions & 0 deletions Classes/ios/UIFont+FlatUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,16 @@ + (UIFont *)italicFlatFontOfSize:(CGFloat)size {
return [UIFont fontWithName:@"Lato-Italic" size:size];
}

+ (UIFont *)lightFlatFontOfSize:(CGFloat)size {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSURL * url = [[NSBundle mainBundle] URLForResource:@"Lato-Light" withExtension:@"ttf"];
CFErrorRef error;
CTFontManagerRegisterFontsForURL((__bridge CFURLRef)url, kCTFontManagerScopeNone, &error);
error = nil;
});
return [UIFont fontWithName:@"Lato-Light" size:size];
}


@end

0 comments on commit b8a0489

Please sign in to comment.